ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class HttpHelper

Helper methods for HTTP request/response handling

Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 0.2
Located at HttpHelper.php

Methods summary

public static resource
# createConnection( triagens\ArangoDb\ConnectionOptions $options )

Create a one-time HTTP connection by opening a socket to the server

Create a one-time HTTP connection by opening a socket to the server

It is the caller's responsibility to close the socket

Parameters

$options
  • connection options

Returns

resource
  • socket with server connection, will throw when no connection can be established

Throws

triagens\ArangoDb\ConnectException
public static string
# buildRequest( triagens\ArangoDb\ConnectionOptions $options, string $connectionHeader, string $method, string $url, string $body, array $customHeaders = [] )

Create a request string (header and body)

Create a request string (header and body)

Parameters

$options
  • connection options
$connectionHeader
  • pre-assembled header string for connection
$method
  • HTTP method
$url
  • HTTP URL
$body
  • optional body to post
$customHeaders
  • any array containing header elements

Returns

string
  • assembled HTTP request string

Throws

triagens\ArangoDb\ClientException
public static boolean
# validateMethod( string $method )

Validate an HTTP request method name

Validate an HTTP request method name

Parameters

$method
  • method name

Returns

boolean
  • always true, will throw if an invalid method name is supplied

Throws

triagens\ArangoDb\ClientException
public static string
# transfer( resource $socket, string $request )

Execute an HTTP request on an opened socket

Execute an HTTP request on an opened socket

It is the caller's responsibility to close the socket

Parameters

$socket
  • connection socket (must be open)
$request
  • complete HTTP request as a string

Returns

string
  • HTTP response string as provided by the server

Throws

triagens\ArangoDb\ClientException
public static array
# parseHttpMessage( string $httpMessage, string $originUrl = null, string $originMethod = null )

Splits a http message into its header and body.

Splits a http message into its header and body.

Parameters

$httpMessage
The http message string.
$originUrl
The original URL the response is coming from
$originMethod
The HTTP method that was used when sending data to the origin URL

Returns

array

Throws

triagens\ArangoDb\ClientException
public static array
# parseHeaders( string $headers )

Process a string of HTTP headers into an array of header => values.

Process a string of HTTP headers into an array of header => values.

Parameters

$headers
  • the headers string

Returns

array

Constants summary

string METHOD_POST

HTTP POST string constant

HTTP POST string constant

# 'POST'
string METHOD_PUT

HTTP PUT string constant

HTTP PUT string constant

# 'PUT'
string METHOD_DELETE

HTTP DELETE string constant

HTTP DELETE string constant

# 'DELETE'
string METHOD_GET

HTTP GET string constant

HTTP GET string constant

# 'GET'
string METHOD_HEAD

HTTP HEAD string constant

HTTP HEAD string constant

# 'HEAD'
string METHOD_PATCH

HTTP PATCH string constant

HTTP PATCH string constant

# 'PATCH'
integer CHUNK_SIZE

Chunk size (number of bytes processed in one batch)

Chunk size (number of bytes processed in one batch)

# 8192
string EOL

End of line mark used in HTTP

End of line mark used in HTTP

# "\r\n"
string SEPARATOR

Separator between header and body

Separator between header and body

# "\r\n\r\n"
string PROTOCOL

HTTP protocol version used, hard-coded to version 1.1

HTTP protocol version used, hard-coded to version 1.1

# 'HTTP/1.1'
string MIME_BOUNDARY

Boundary string for batch request parts

Boundary string for batch request parts

# 'XXXsubpartXXX'
string ASYNC_HEADER

HTTP Header for making an operation asynchronous

HTTP Header for making an operation asynchronous

# 'X-Arango-Async'
ArangoDB-PHP API Documentation API documentation generated by ApiGen