-
Notifications
You must be signed in to change notification settings - Fork 12
7.3. cURL
Cradle\Curl is a wrapper for the PHP curl function.
use Cradle\Curl\CurlHandler;
$curl = CurlHandler::i();
$results = $curl
->setUrl('http://iamawesome.com')
->setPostFields([
'foo' => 'bar'
])
->getResponse();$curl->setAutoReferer(true) // Same as CURLOPT_AUTOREFERERSee http://docs.php.net/manual/da/function.curl-setopt.php for all the options
Send the curl off and returns the results parsed as DOMDocument
-
Returns:
DOMDOcument
Send the curl off and returns the results parsed as JSON
-
Parameters:
$assoc—bool— To use associative array instead -
Returns:
array
Returns the meta of the last call
-
Parameters:
$key—string|null— The name of the key in meta -
Returns:
array
Send the curl off and returns the results parsed as url query
-
Returns:
array
Send the curl off and returns the results
-
Returns:
string
Send the curl off and returns the results parsed as SimpleXml
-
Returns:
SimpleXmlElement
Send the curl off
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom GET instead
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom OPTIONS instead
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom POST instead
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom PATCH instead
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom PUT instead
-
Returns:
CurlHandler
Curl has problems handling custom request types from misconfigured end points or vice versa. When default cURL fails, try a custom DELETE instead
-
Returns:
CurlHandler
CURLOPT_POSTFIELDS accepts array and string arguments, this is a special case that __call does not handle
-
Parameters:
-
$fields—*string|array— the post data to send -
$type—string— query or json
-
-
Returns:
CurlHandler
Sets request headers
-
Parameters:
-
$key—*array|string— The header name -
$value—scalar|null— The header value
-
-
Returns:
CurlHandler
Sets url parameter
-
Parameters:
-
$key—*array|string— The parameter name -
$value—scalar— The parameter value
-
-
Returns:
CurlHandler
Sets CURLOPT_SSL_VERIFYHOST
-
Parameters:
$on—bool— Flag to verify host -
Returns:
CurlHandler
Sets CURLOPT_SSL_VERIFYPEER
-
Parameters:
$on—bool— Flag to verify peer -
Returns:
CurlHandler
2.B. Reference: Validation Types
2.D. Reference: Indexes & Relations
3.A. Reference: Cradle on Shared Hosts
3.B. Reference: Command Line Tools
3.C. Reference: Architecture Recommendations
4.4. Intro to Handlebars Templating
4.B. Reference: Handlebars Helpers
4.C. Reference: Doon Interfaces
4.D. Reference: Global Package Methods