Property | Type | Description | |
---|---|---|---|
$automaticRequestHeaders | |||
$followRedirects | boolean | If redirects should be followed | |
$lastRequest | |||
$lastResponse | |||
$maximumRedirections | integer | The very maximum amount of redirections to follow if there is a "Location" redirect (see also $redirectionStack property) | |
$redirectionStack | array | A simple string array that keeps track of occurred "Location" header redirections to avoid infinite loops if the same redirection happens | |
$requestEngine | Neos\Flow\Http\Client\RequestEngineInterface |
Method | Description | |
---|---|---|
__construct ( ) | Construct the Browser instance. | |
addAutomaticRequestHeader ( string $name, array | string | DateTime $values ) : void | Allows to add headers to be sent with every request the browser executes. | |
getCrawler ( ) : |
Returns the DOM crawler which can be used to interact with the web page structure, submit forms, click links or fetch specific parts of the website's contents. | |
getForm ( string $xpath = '//form' ) : |
Get the form specified by $xpath. If no $xpath given, return the first form on the page. | |
getLastRequest ( ) : |
Returns the last request executed. | |
getLastResponse ( ) : |
Returns the response received after the last request. | |
getRequestEngine ( ) : Neos\Flow\Http\Client\RequestEngineInterface | Returns the request engine used by this Browser. | |
removeAutomaticRequestHeader ( string $name ) : void | Allows to remove headers that were added with addAutomaticRequestHeader. | |
request ( string | |
Requests the given URI with the method and other parameters as specified. | |
sendRequest ( |
Sends a prepared request and returns the respective response. | |
setFollowRedirects ( boolean $flag ) : void | Sets a flag if redirects should be followed or not. | |
setRequestEngine ( Neos\Flow\Http\Client\RequestEngineInterface $requestEngine ) : void | Inject the request engine | |
submit ( |
Submit a form |
public getCrawler ( ) : |
||
return |
public getLastRequest ( ) : |
||
return | The HTTP request or NULL if there wasn't a request yet |
public getLastResponse ( ) : |
||
return | The HTTP response or NULL if there wasn't a response yet |
public getRequestEngine ( ) : Neos\Flow\Http\Client\RequestEngineInterface | ||
return | Neos\Flow\Http\Client\RequestEngineInterface |
public removeAutomaticRequestHeader ( string $name ) : void | ||
$name | string | Name of the header, for example "Location", "Content-Description" etc. |
return | void |
public request ( string | |
||
$uri | string | |
|
$method | string | Request method, for example "GET" |
$arguments | array | Arguments to send in the request body |
$files | array | |
$server | array | |
$content | string | |
return | The HTTP response |
public sendRequest ( |
||
$request | ||
return |
public setFollowRedirects ( boolean $flag ) : void | ||
$flag | boolean | |
return | void |
public setRequestEngine ( Neos\Flow\Http\Client\RequestEngineInterface $requestEngine ) : void | ||
$requestEngine | Neos\Flow\Http\Client\RequestEngineInterface | |
return | void |
public submit ( |
||
$form | ||
return |
protected Headers,Neos\Flow\Http $automaticRequestHeaders | ||
return |
protected bool $followRedirects | ||
return | boolean |
protected Request,Neos\Flow\Http $lastRequest | ||
return |
protected Response,Neos\Flow\Http $lastResponse | ||
return |
protected int $maximumRedirections | ||
return | integer |
protected array $redirectionStack | ||
return | array |