DOMClient
class DOMClient extends AbstractBrowser
This class provides access to a local or remote http server with a URL as a browser does
Properties
private array | $httpserver | ||
private array | $parameters |
Methods
Constructor of class DOMClient
Returns an instance of this class as a client to access a local or remote server.
Calls a URI and returns a Crawler object to navigate in a list of \DOMNode objects.
Calls a URI with the GET request method and returns a Crawler object to navigate in a list of \DOMNode objects.
Calls a URI with the POST request method and returns a Crawler object to navigate in a list of \DOMNode objects.
Executes the request
Executes the request to the remote server
Executes the request to the local server
Decodes a chunked content
function makeRequestHeader
Makes a socket adress for a remote server
Returns the path part of an uri.
Encodes data to be usable in an url or a html form.
Generates a random cryptographic nonce
Details
at line 101
void
__construct(array $server = array())
Constructor of class DOMClient
at line 114
static DOMClient
createClient(array $server = array())
Returns an instance of this class as a client to access a local or remote server.
at line 132
Crawler|string
request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
Calls a URI and returns a Crawler object to navigate in a list of \DOMNode objects.
at line 151
Crawler|string
get(string $uri, array $headers = array())
Calls a URI with the GET request method and returns a Crawler object to navigate in a list of \DOMNode objects.
at line 165
Crawler|string
post(string $uri, array $headers = array(), array $data = array())
Calls a URI with the POST request method and returns a Crawler object to navigate in a list of \DOMNode objects.
at line 177
protected Response
doRequest(object $request)
Executes the request
at line 200
private Response
doRemoteRequest(object $request, string $scheme)
Executes the request to the remote server
at line 273
private Response
doLocalRequest(object $request, string $path)
Executes the request to the local server
at line 298
private string
decodeChunked(string $chunked)
Decodes a chunked content
at line 317
private mixed|string
makeRequestHeader(mixed $request, mixed $contentLength = 0)
function makeRequestHeader
at line 356
string
makeRemote(array $server)
Makes a socket adress for a remote server
at line 374
string
getPath(string $uri)
Returns the path part of an uri.
at line 391
string
encodeData(array|string $data)
Encodes data to be usable in an url or a html form.
at line 417
string
randomNonce(int $bits = 256)
Generates a random cryptographic nonce