\Everyman\Neo4jTransport

Class for communicating with an HTTP JSON endpoint

Summary

Methods
Properties
Constants
__construct()
__destruct()
getEndpoint()
encodeData()
makeRequest()
get()
post()
put()
delete()
setAuth()
useHttps()
No public properties found
GET
POST
PUT
DELETE
getHandle()
$scheme
$host
$port
$path
$username
$password
$handle
N/A
No private methods found
No private properties found
N/A

Constants

GET

GET

POST

POST

PUT

PUT

DELETE

DELETE

Properties

$scheme

$scheme : 

Type

$host

$host : 

Type

$port

$port : 

Type

$path

$path : 

Type

$username

$username : 

Type

$password

$password : 

Type

$handle

$handle : 

Type

Methods

__construct()

__construct(string $host, integer $port)

Set the host and port of the endpoint

Parameters

string $host
integer $port

__destruct()

__destruct()

Make sure the curl handle closes when we are done with the Transport

getEndpoint()

getEndpoint() : string

Return the Neo4j REST endpoint

Returns

string

encodeData()

encodeData(mixed $data) : string

Encode data for transport

Parameters

mixed $data

Returns

string

makeRequest()

makeRequest(string $method, string $path, array $data) : array

Make a request against the endpoint Returned array has the following elements: 'code' => the HTTP status code returned 'headers' => array of HTTP headers, indexed by header name 'data' => array return data

Parameters

string $method
string $path
array $data

Returns

array

get()

get( $path,  $data) : array

Make a GET request

Parameters

$path
$data

Returns

array —

see 'makeRequest'

post()

post( $path,  $data) : array

Make a POST request

Parameters

$path
$data

Returns

array —

see 'makeRequest'

put()

put( $path,  $data) : array

Make a PUT request

Parameters

$path
$data

Returns

array —

see 'makeRequest'

delete()

delete( $path) : array

Make a DELETE request

Parameters

$path

Returns

array —

see 'makeRequest'

setAuth()

setAuth(string $username, string $password) : \Everyman\Neo4j\Transport

Set username and password to use with HTTP Basic Auth

Returns this Trnasport object

Parameters

string $username
string $password

Returns

\Everyman\Neo4j\Transport

useHttps()

useHttps(boolean $useHttps) : \Everyman\Neo4j\Transport

Turn HTTPS on or off

Returns this Trnasport object

Parameters

boolean $useHttps

Returns

\Everyman\Neo4j\Transport

getHandle()

getHandle() : resource

Get the cURL handle

Returns

resource —

cURL handle