[ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
HTTP API: WP_Http_Curl class
File Size: | 411 lines (12 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
WP_Http_Curl:: (4 methods):
request()
stream_headers()
stream_body()
test()
Class: WP_Http_Curl - X-Ref
Core class used to integrate Curl as an HTTP transport.request( $url, $args = array() X-Ref |
Send a HTTP request to a URI using cURL extension. return: array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error param: string $url The request URL. param: string|array $args Optional. Override the defaults. since: 2.7.0 |
stream_headers( $handle, $headers ) X-Ref |
Grabs the headers of the cURL request. Each header is sent individually to this callback, so we append to the `$header` property for temporary storage return: int Length of the request headers. param: resource $handle cURL handle. param: string $headers cURL request headers. since: 3.2.0 |
stream_body( $handle, $data ) X-Ref |
Grabs the body of the cURL request. The contents of the document are passed in chunks, so we append to the `$body` property for temporary storage. Returning a length shorter than the length of `$data` passed in will cause cURL to abort the request with `CURLE_WRITE_ERROR`. return: int Total bytes of data written. param: resource $handle cURL handle. param: string $data cURL request body. since: 3.6.0 |
test( $args = array() X-Ref |
Determines whether this class can be used for retrieving a URL. return: bool False means this class can not be used, true means it can. param: array $args Optional. Array of request arguments. Default empty array. since: 2.7.0 |
Generated: Sat Nov 23 01:00:02 2024 | Cross-referenced by PHPXref 0.7.1 |