Property | Type | Description | |
---|---|---|---|
$curlObject | resource | cURL request | |
$curlOptions | array | Array of cURL options | |
$packageOptions | array | Array with options that are not specific to cURL but are used by the package |
Method | Description | |
---|---|---|
allowRedirect ( ) : |
Allow for redirects in the request | |
asJson ( boolean $asArray = false ) : |
Configure the package to encode and decode the request data | |
asJsonRequest ( ) : |
Configure the package to encode the request data to json before sending it to the server | |
asJsonResponse ( boolean $asArray = false ) : |
Configure the package to decode the request data from json to object or associative array | |
containsFile ( ) : |
Enable File sending | |
delete ( ) : mixed | Send a DELETE request to a URL using the specified cURL options | |
download ( string $fileName ) : mixed | Send a download request to a URL using the specified cURL options | |
enableDebug ( string $logFile ) : |
Enable debug mode for the cURL request | |
get ( ) : mixed | Send a GET request to a URL using the specified cURL options | |
patch ( ) : mixed | Send a PATCH request to a URL using the specified cURL options | |
post ( ) : mixed | Send a POST request to a URL using the specified cURL options | |
put ( ) : mixed | Send a PUT request to a URL using the specified cURL options | |
returnResponseObject ( ) : |
Return a full response object with HTTP status and headers instead of only the content | |
to ( $url ) : |
Set the URL to which the request is to be sent | |
withContentType ( string $contentType ) : |
Add a content type HTTP header to the request | |
withData ( array $data = [] ) : |
Add GET or POST data to the request | |
withHeader ( string $header ) : |
Add a HTTP header to the request | |
withHeaders ( array $headers ) : |
Add multiple HTTP header at the same time to the request | |
withOption ( string $key, string $value ) : |
Set any specific cURL option | |
withTimeout ( integer $timeout = 30 ) : |
Set the request timeout |
Method | Description | |
---|---|---|
appendDataToURL ( ) : string | Append set data to the query string for GET and DELETE cURL requests | |
forgeOptions ( ) : array | Convert the curlOptions to an array of usable options for the cURL request | |
returnResponse ( mixed $content, array $responseData = [] ) : stdClas\stdClass | ||
send ( ) : mixed | Send the request | |
setPostParameters ( ) | Add POST parameters to the curlOptions array | |
withCurlOption ( string $key, string $value ) : |
Set any specific cURL option | |
withPackageOption ( string $key, string $value ) : |
Set any specific package option |
public allowRedirect ( ) : |
||
return |
protected appendDataToURL ( ) : string | ||
return | string |
public asJsonRequest ( ) : |
||
return |
public asJsonResponse ( boolean $asArray = false ) : |
||
$asArray | boolean | Indicates whether or not the data should be returned as an array. Default: false |
return |
public enableDebug ( string $logFile ) : |
||
$logFile | string | The full path to the log file you want to use |
return |
protected forgeOptions ( ) : array | ||
return | array |
protected returnResponse ( mixed $content, array $responseData = [] ) : stdClas\stdClass | ||
$content | mixed | Content of the request |
$responseData | array | Additional response information |
return | stdClas\stdClass |
public returnResponseObject ( ) : |
||
return |
protected setPostParameters ( ) |
public to ( $url ) : |
||
$url | string The URL to which the request is to be sent | |
return |
public withContentType ( string $contentType ) : |
||
$contentType | string | The content type of the file you would like to download |
return |
protected withCurlOption ( string $key, string $value ) : |
||
$key | string | The name of the cURL option |
$value | string | The value to which the option is to be set |
return |
public withHeader ( string $header ) : |
||
$header | string | The HTTP header that is to be added to the request |
return |
public withHeaders ( array $headers ) : |
||
$headers | array | Array of HTTP headers that must be added to the request |
return |
public withOption ( string $key, string $value ) : |
||
$key | string | The name of the cURL option |
$value | string | The value to which the option is to be set |
return |
protected withPackageOption ( string $key, string $value ) : |
||
$key | string | The name of the cURL option |
$value | string | The value to which the option is to be set |
return |
public withTimeout ( integer $timeout = 30 ) : |
||
$timeout | integer | The timeout for the request (in seconds. Default: 30 seconds) |
return |
protected array $packageOptions | ||
return | array |