Helper methods for HTTP request/response handling
| package | ArangoDBClient |
|---|---|
| since | 0.2 |
buildRequest(\ArangoDBClient\ConnectionOptions $options, string $connectionHeader, string $method, string $url, string $body, array $customHeaders = array()) : string
\ArangoDBClient\ConnectionOptionsstringstringstringstringarray\ArangoDBClient\ClientException |
|---|
string- assembled HTTP request stringcreateConnection(\ArangoDBClient\ConnectionOptions $options) : resource
It is the caller's responsibility to close the socket
\ArangoDBClient\ConnectionOptions\ArangoDBClient\ConnectException |
|---|
resource- socket with server connection, will throw when no connection can be establishedparseHeaders(string $headers) : array
stringarrayparseHttpMessage(string $httpMessage, string $originUrl= null, string $originMethod= null) : array
stringThe http message string.
stringThe original URL the response is coming from
stringThe HTTP method that was used when sending data to the origin URL
\ArangoDBClient\ClientException |
|---|
arraytransfer(resource $socket, string $request, string $method) : string
It is the caller's responsibility to close the socket
resourcestringstring\ArangoDBClient\ClientException |
|---|
string- HTTP response string as provided by the servervalidateMethod(string $method) : boolean
string\ArangoDBClient\ClientException |
|---|
boolean- always true, will throw if an invalid method name is suppliedASYNC_HEADER = 'X-Arango-Async'
CHUNK_SIZE = 8192
EOL = "\r\n"
METHOD_DELETE = 'DELETE'
METHOD_GET = 'GET'
METHOD_HEAD = 'HEAD'
METHOD_PATCH = 'PATCH'
METHOD_POST = 'POST'
METHOD_PUT = 'PUT'
MIME_BOUNDARY = 'XXXsubpartXXX'
PROTOCOL = 'HTTP/1.1'
SEPARATOR = "\r\n\r\n"