phalconplus Documentation v1.1.0
Source
Class PhalconPlus Curl

# Request

Methods

- __construct(variable $curl) : void
  Constructor
- setMethod(string $method) : void
  Set the HTTP method of the request.
- getMethod() : void
  Get the HTTP method of the request.
- setUrl(string $url) : void
  Set the URL of the request.
- getUrl() : void
  Get the URL of the request.
- setHeader(variable $key, variable $value, bool $preserveCase) : void
  Set a specific header to be sent with the request.
- setHeaders(array $headers) : void
  Set the headers to be sent with the request.
- getHeader(string $key) : void
  Get a specific header from the request.
- getHeaders() : void
  Get the headers to be sent with the request.
- setCookie(string $key, string $value) : void
  Set a cookie.
- setCookies(array $cookies) : void
  Replace the request's cookies.
- updateCookieHeader() : void
  Read the request cookies and set the cookie header.
- getCookie(string $key) : void
  Get a specific cookie from the request.
- getCookies() : void
  Get all the request's cookies.
- formatHeaders() : void
  Format the headers to an array of 'key: val' which can be passed to
- setData(variable $data) : void
  Set the POST data to be sent with the request.
- hasData() : void
  Check whether the request has any data.
- getData() : void
  Get the POST data to be sent with the request.
- setEncoding(int $encoding) : void
  Set the encoding to use on the POST data, and (possibly) associated Content-Type headers
- getEncoding() : void
  Get the current encoding which will be used on the POST data
- encodeData() : void
  Encode the POST data as a string.
- setOption(string $key, variable $value) : void
  Set a specific curl option for the request.
- setOptions(array $options) : void
  Set the cURL options for the request.
- getOption(string $key) : void
  Get a specific curl option from the request.
- getOptions() : void
  Get the cURL options for the request.
- auth(string $user, string $pass) : void
  Set the HTTP basic username and password.
- setUser(string $user) : void
  Set an username to authenticate the request of curl.
- setPass(string $pass) : void
  Set a password to authenticate the request of curl.
- getUserAndPass() : void
  If username and password is set, returns a string of 'username:password'.
- isJson() : void
  Whether the request is JSON or not.
- send() : void
  Send the request.
- zephir_init_static_properties_PhalconPlus_Curl_Request() : void
- zephir_init_properties_PhalconPlus_Curl_Request() : void

Methods Details

- public function __construct(variable $curl)

  Constructor

- public function setMethod(string $method)

  Set the HTTP method of the request.

- public function getMethod()

  Get the HTTP method of the request.

- public function setUrl(string $url)

  Set the URL of the request.

- public function getUrl()

  Get the URL of the request.

- public function setHeader(variable $key, variable $value, bool $preserveCase)

  Set a specific header to be sent with the request.

- public function setHeaders(array $headers)

  Set the headers to be sent with the request.
  Pass an associative array - e.g. ['Content-Type' => 'application/json'] and the correct header formatting - e.g. 'Content-Type: application/json' will be done for you when the request is sent.

- public function getHeader(string $key)

  Get a specific header from the request.

- public function getHeaders()

  Get the headers to be sent with the request.

- public function setCookie(string $key, string $value)

  Set a cookie.

- public function setCookies(array $cookies)

  Replace the request's cookies.

- private function updateCookieHeader()

  Read the request cookies and set the cookie header.

- public function getCookie(string $key)

  Get a specific cookie from the request.

- public function getCookies()

  Get all the request's cookies.

- public function formatHeaders()

  Format the headers to an array of 'key: val' which can be passed to
  curl_setopt.

- public function setData(variable $data)

  Set the POST data to be sent with the request.

- public function hasData()

  Check whether the request has any data.

- public function getData()

  Get the POST data to be sent with the request.

- public function setEncoding(int $encoding)

  Set the encoding to use on the POST data, and (possibly) associated Content-Type headers

- public function getEncoding()

  Get the current encoding which will be used on the POST data

- public function encodeData()

  Encode the POST data as a string.

- public function setOption(string $key, variable $value)

  Set a specific curl option for the request.

- public function setOptions(array $options)

  Set the cURL options for the request.

- public function getOption(string $key)

  Get a specific curl option from the request.

- public function getOptions()

  Get the cURL options for the request.

- public function auth(string $user, string $pass)

  Set the HTTP basic username and password.

- public function setUser(string $user)

  Set an username to authenticate the request of curl.

- public function setPass(string $pass)

  Set a password to authenticate the request of curl.

- public function getUserAndPass()

  If username and password is set, returns a string of 'username:password'.
  If not, returns null.

- public function isJson()

  Whether the request is JSON or not.

- public function send()

  Send the request.

- internal function zephir_init_static_properties_PhalconPlus_Curl_Request()

- internal function zephir_init_properties_PhalconPlus_Curl_Request()