RESTClient
public class RESTClient
Constructor Summary | |
---|---|
void | __construct(str host, int port, str path, str version, str username, str password, str auth, mixed logger) |
Method Summary | |
---|---|
void | setHost(string host) Set the host. |
void | setPort(string port) Set the port. |
void | setPath(string path) Set the path. |
void | setVersion(string version) Set the version. |
void | setUsername(string username) Set the username. |
void | setPassword(string password) Set the password. |
void | setAuth(string auth) Set the authentication scheme. |
void | setPrefix(string prefix) Set the URL prefix. |
string | Get the URL prefix. |
void | setLogger(LoggerInterface logger) Set the logger. |
LoggerInterface | Get the logger. |
RESTResponse | send(RESTRequest request) Send a REST request. |
protected array | setOptions(resource ch, string url, array headers, mixed urlStr) Set cURL options common to all requests |
RESTResponse | get(RESTRequest request) Perform a GET request with cURL |
RESTResponse | put(RESTRequest request) Perform a PUT request with cURL |
RESTResponse | delete(RESTRequest request) Perform a DELETE request with cURL |
RESTResponse | post(RESTRequest request) Perform a POST request with cURL |
RESTResponse | head(RESTRequest request) Perform a HEAD request with cURL |
protected RESTResponse | execute(resource ch) Execute a cURL request. |
void | installExtension($resource URL, $params resource, $filename file, mixed params, mixed filename) Install a REST API XQuery extension |
public void __construct(str host, int port, str path, str version, str username, str password, str auth, mixed logger)
public void setHost(string host)
Set the host.
public void setPort(string port)
Set the port.
public void setPath(string path)
Set the path.
public void setVersion(string version)
Set the version.
public void setUsername(string username)
Set the username.
public void setPassword(string password)
Set the password.
public void setAuth(string auth)
Set the authentication scheme.
public void setPrefix(string prefix)
Set the URL prefix. Allows you to create a custom URL when no arguments are passed at construction.
public string getPrefix()
Get the URL prefix.
public void setLogger(LoggerInterface logger)
Set the logger.
public LoggerInterface getLogger()
Get the logger.
public RESTResponse send(RESTRequest request)
Send a REST request.
protected array setOptions(resource ch, string url, array headers, mixed urlStr)
Set cURL options common to all requests
public RESTResponse get(RESTRequest request)
Perform a GET request with cURL
public RESTResponse put(RESTRequest request)
Perform a PUT request with cURL
public RESTResponse delete(RESTRequest request)
Perform a DELETE request with cURL
public RESTResponse post(RESTRequest request)
Perform a POST request with cURL
public RESTResponse head(RESTRequest request)
Perform a HEAD request with cURL
protected RESTResponse execute(resource ch)
Execute a cURL request.
public void installExtension($resource URL, $params resource, $filename file, mixed params, mixed filename)
Install a REST API XQuery extension
Represents a REST client.