-
Constructor
-
Set the HTTP method of the request.
-
getMethod() : voidGet the HTTP method of the request.
-
Set the URL of the request.
-
getUrl() : voidGet the URL of the request.
-
Set a specific header to be sent with the request.
-
Set the headers to be sent with the request.
-
Get a specific header from the request.
-
getHeaders() : voidGet the headers to be sent with the request.
-
Set a cookie.
-
Replace the request's cookies.
-
updateCookieHeader() : voidRead the request cookies and set the cookie header.
-
Get a specific cookie from the request.
-
getCookies() : voidGet all the request's cookies.
-
formatHeaders() : voidFormat the headers to an array of 'key: val' which can be passed to
-
Set the POST data to be sent with the request.
-
hasData() : voidCheck whether the request has any data.
-
getData() : voidGet the POST data to be sent with the request.
-
Set the encoding to use on the POST data, and (possibly) associated Content-Type headers
-
getEncoding() : voidGet the current encoding which will be used on the POST data
-
encodeData() : voidEncode the POST data as a string.
-
Set a specific curl option for the request.
-
Set the cURL options for the request.
-
Get a specific curl option from the request.
-
getOptions() : voidGet the cURL options for the request.
-
Set the HTTP basic username and password.
-
Set an username to authenticate the request of curl.
-
Set a password to authenticate the request of curl.
-
getUserAndPass() : voidIf username and password is set, returns a string of 'username:password'.
-
isJson() : voidWhether the request is JSON or not.
-
send() : voidSend the request.
-
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 tocurl_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()