WordPress 3.0 beta 1 documentation kindly provided to you by Hay Kranen
| [ Index ] |
PHP Cross Reference of WordPress 3.0 beta 1 |
|
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Source view] [Print] [Project Stats]
Simple and uniform HTTP request API. Will eventually replace and standardize the WordPress HTTP requests made.
| File Size: | 197 lines (5 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 1 file wp-includes/class-http.php |
| _wp_http_get_object() X-Ref |
| Returns the initialized WP_Http Object return: WP_Http HTTP Transport object. |
| wp_remote_request($url, $args = array() X-Ref |
| Retrieve the raw response from the HTTP request. The array structure is a little complex. <code> $res = array( 'headers' => array(), 'response' => array('code' => int, 'message' => string) ); </code> All of the headers in $res['headers'] are with the name as the key and the value as the value. So to get the User-Agent, you would do the following. <code> $user_agent = $res['headers']['user-agent']; </code> The body is the raw response content and can be retrieved from $res['body']. This function is called first to make the request and there are other API functions to abstract out the above convoluted setup. param: string $url Site URL to retrieve. param: array $args Optional. Override the defaults. return: WP_Error|array The response or WP_Error on failure. |
| wp_remote_get($url, $args = array() X-Ref |
| Retrieve the raw response from the HTTP request using the GET method. param: string $url Site URL to retrieve. param: array $args Optional. Override the defaults. return: WP_Error|array The response or WP_Error on failure. |
| wp_remote_post($url, $args = array() X-Ref |
| Retrieve the raw response from the HTTP request using the POST method. param: string $url Site URL to retrieve. param: array $args Optional. Override the defaults. return: WP_Error|array The response or WP_Error on failure. |
| wp_remote_head($url, $args = array() X-Ref |
| Retrieve the raw response from the HTTP request using the HEAD method. param: string $url Site URL to retrieve. param: array $args Optional. Override the defaults. return: WP_Error|array The response or WP_Error on failure. |
| wp_remote_retrieve_headers(&$response) X-Ref |
| Retrieve only the headers from the raw response. param: array $response HTTP response. return: array The headers of the response. Empty array if incorrect parameter given. |
| wp_remote_retrieve_header(&$response, $header) X-Ref |
| Retrieve a single header by name from the raw response. param: array $response param: string $header Header name to retrieve value from. return: string The header value. Empty string on if incorrect parameter given, or if the header doesnt exist. |
| wp_remote_retrieve_response_code(&$response) X-Ref |
| Retrieve only the response code from the raw response. Will return an empty array if incorrect parameter value is given. param: array $response HTTP response. return: string the response code. Empty string on incorrect parameter given. |
| wp_remote_retrieve_response_message(&$response) X-Ref |
| Retrieve only the response message from the raw response. Will return an empty array if incorrect parameter value is given. param: array $response HTTP response. return: string The response message. Empty string on incorrect parameter given. |
| wp_remote_retrieve_body(&$response) X-Ref |
| Retrieve only the body from the raw response. param: array $response HTTP response. return: string The body of the response. Empty string if no body or incorrect parameter given. |
| Generated: Mon Apr 5 14:26:09 2010 | Cross-referenced by PHPXref 0.7 |