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\ConnectionOptions
string
string
string
string
array
\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
string
array
parseHttpMessage(string $httpMessage, string $originUrl= null
, string $originMethod= null
) : array
string
The http message string.
string
The original URL the response is coming from
string
The HTTP method that was used when sending data to the origin URL
\ArangoDBClient\ClientException |
---|
array
transfer(resource $socket, string $request, string $method) : string
It is the caller's responsibility to close the socket
resource
string
string
\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"