Make WordPress Core

Ticket #7550: 7550.r8841.diff

File 7550.r8841.diff, 1.3 KB (added by jacobsantos, 17 years ago)

corrections for http.php based off of r8841.

  • http.php

     
    10241024 * The array structure is a little complex.
    10251025 *
    10261026 * <code>
    1027  * $res = array( 'headers' =>
    1028  *              'response' => array('code', 'message'),
    1029  *              'headers' => array()
    1030  * );
     1027 * $res = array( 'headers' => array(), 'response' => array('code', 'message') );
    10311028 * </code>
    10321029 *
    1033  * All of the headers in $res['headers']['headers'] are with the name as the key
    1034  * and the value as the value. So to get the User-Agent, you would do the
    1035  * following.
     1030 * All of the headers in $res['headers'] are with the name as the key and the
     1031 * value as the value. So to get the User-Agent, you would do the following.
    10361032 *
    10371033 * <code>
    1038  * $user_agent = $res['headers']['headers']['user-agent'];
     1034 * $user_agent = $res['headers']['user-agent'];
    10391035 * </code>
    10401036 *
    10411037 * The body is the raw response content and can be retrieved from $res['body'].
     
    10431039 * This function is called first to make the request and there are other API
    10441040 * functions to abstract out the above convoluted setup.
    10451041 *
    1046  * @since 2.7
     1042 * @since 2.7.0
    10471043 *
    10481044 * @param string $url Site URL to retrieve.
    10491045 * @param array $args Optional. Override the defaults.