[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/Requests/Transport/ -> cURL.php (summary)

cURL HTTP transport

File Size: 589 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Requests_Transport_cURL:: (12 methods):
  __construct()
  __destruct()
  request()
  request_multiple()
  get_subrequest_handle()
  setup_handle()
  process_response()
  stream_headers()
  stream_body()
  format_get()
  test()
  get_expect_header()


Class: Requests_Transport_cURL  - X-Ref

cURL HTTP transport

__construct()   X-Ref
Constructor


__destruct()   X-Ref
Destructor


request($url, $headers = array()   X-Ref
Perform a request

return: string Raw HTTP result
param: string $url URL to request
param: array $headers Associative array of request headers
param: string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
param: array $options Request options, see {@see Requests::response()} for documentation

request_multiple($requests, $options)   X-Ref
Send multiple requests simultaneously

return: array Array of Requests_Response objects (may contain Requests_Exception or string responses as well)
param: array $requests Request data
param: array $options Global options

get_subrequest_handle($url, $headers, $data, $options)   X-Ref
Get the cURL handle for use in a multi-request

return: resource Subrequest's cURL handle
param: string $url URL to request
param: array $headers Associative array of request headers
param: string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
param: array $options Request options, see {@see Requests::response()} for documentation

setup_handle($url, $headers, $data, $options)   X-Ref
Setup the cURL handle for the given data

param: string $url URL to request
param: array $headers Associative array of request headers
param: string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD
param: array $options Request options, see {@see Requests::response()} for documentation

process_response($response, $options)   X-Ref
Process a response

return: string|false HTTP response data including headers. False if non-blocking.
param: string $response Response data from the body
param: array $options Request options

stream_headers($handle, $headers)   X-Ref
Collect the headers as they are received

return: integer Length of provided header
param: resource $handle cURL resource
param: string $headers Header string

stream_body($handle, $data)   X-Ref
Collect data as it's received

return: integer Length of provided data
since: 1.6.1
param: resource $handle cURL resource
param: string $data Body data

format_get($url, $data)   X-Ref
Format a URL given GET data

return: string URL with data
param: string $url
param: array|object $data Data to build query using, see {@see https://secure.php.net/http_build_query}

test($capabilities = array()   X-Ref
Whether this transport is valid

return: boolean True if the transport is valid, false otherwise.

get_expect_header($data)   X-Ref
Get the correct "Expect" header for the given request data.

return: string The "Expect" header.
param: string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD.



Generated: Thu Dec 15 01:00:02 2022 Cross-referenced by PHPXref 0.7.1