[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-http-curl.php (summary)

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

Defines 1 class

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.

HTTP request method uses Curl extension to retrieve the url.

Requires the Curl extension to be installed.

request( $url, $args = array()   X-Ref
Send a HTTP request to a URI using cURL extension.

param: string       $url  The request URL.
param: string|array $args Optional. Override the defaults.
return: array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
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

param: resource $handle  cURL handle.
param: string   $headers cURL request headers.
return: int Length of the 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`.

param: resource $handle  cURL handle.
param: string   $data    cURL request body.
return: int Total bytes of data written.
since: 3.6.0

test( $args = array()   X-Ref
Determines whether this class can be used for retrieving a URL.

param: array $args Optional. Array of request arguments. Default empty array.
return: bool False means this class can not be used, true means it can.
since: 2.7.0



Generated: Fri Oct 4 01:00:02 2024 Cross-referenced by PHPXref 0.7.1