Changeset 29230 for trunk/src/wp-includes/http.php
- Timestamp:
- 07/18/2014 10:00:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/http.php
r28257 r29230 35 35 * URL. The URL is validated to avoid redirection and request forgery attacks. 36 36 * 37 * @see wp_remote_request() For more information on the response array format38 * and default arguments.39 *40 37 * @since 3.6.0 41 38 * 42 * @param string $url Site URL to retrieve. 43 * @param array $args Optional. Override the defaults. 39 * @see wp_remote_request() For more information on the response array format. 40 * @see WP_Http::request() For default arguments information. 41 * 42 * @param string $url Site URL to retrieve. 43 * @param array $args Optional. Request arguments. Default empty array. 44 44 * @return WP_Error|array The response or WP_Error on failure. 45 45 */ … … 56 56 * URL. The URL is validated to avoid redirection and request forgery attacks. 57 57 * 58 * @see wp_remote_request() For more information on the response array format59 * and default arguments.60 *61 58 * @since 3.6.0 62 59 * 63 * @param string $url Site URL to retrieve. 64 * @param array $args Optional. Override the defaults. 60 * @see wp_remote_request() For more information on the response array format. 61 * @see WP_Http::request() For default arguments information. 62 * 63 * @param string $url Site URL to retrieve. 64 * @param array $args Optional. Request arguments. Default empty array. 65 65 * @return WP_Error|array The response or WP_Error on failure. 66 66 */ … … 77 77 * URL. The URL is validated to avoid redirection and request forgery attacks. 78 78 * 79 * @see wp_remote_request() For more information on the response array format80 * and default arguments.81 *82 79 * @since 3.6.0 83 80 * 84 * @param string $url Site URL to retrieve. 85 * @param array $args Optional. Override the defaults. 81 * @see wp_remote_request() For more information on the response array format. 82 * @see WP_Http::request() For default arguments information. 83 * 84 * @param string $url Site URL to retrieve. 85 * @param array $args Optional. Request arguments. Default empty array. 86 86 * @return WP_Error|array The response or WP_Error on failure. 87 87 */ … … 98 98 * URL. The URL is validated to avoid redirection and request forgery attacks. 99 99 * 100 * @see wp_remote_request() For more information on the response array format101 * and default arguments.102 *103 100 * @since 3.6.0 104 101 * 102 * @see wp_remote_request() For more information on the response array format. 103 * @see WP_Http::request() For default arguments information. 104 * 105 105 * @param string $url Site URL to retrieve. 106 * @param array $args Optional. Override the defaults.106 * @param array $args Optional. Request arguments. Default empty array. 107 107 * @return WP_Error|array The response or WP_Error on failure. 108 108 */ … … 116 116 * Retrieve the raw response from the HTTP request. 117 117 * 118 * The array structure is a little complex. 119 * 120 * <code> 121 * $res = array( 'headers' => array(), 'response' => array('code' => int, 'message' => string) ); 122 * </code> 118 * The array structure is a little complex: 119 * 120 * $res = array( 121 * 'headers' => array(), 122 * 'response' => array( 123 * 'code' => int, 124 * 'message' => string 125 * ) 126 * ); 123 127 * 124 128 * All of the headers in $res['headers'] are with the name as the key and the 125 129 * value as the value. So to get the User-Agent, you would do the following. 126 130 * 127 * <code> 128 * $user_agent = $res['headers']['user-agent']; 129 * </code> 131 * $user_agent = $res['headers']['user-agent']; 130 132 * 131 133 * The body is the raw response content and can be retrieved from $res['body']. … … 134 136 * functions to abstract out the above convoluted setup. 135 137 * 136 * List of default arguments: 137 * 'method' => 'GET' 138 * Request method defaults for helper functions: 138 139 * - Default 'GET' for wp_remote_get() 139 140 * - Default 'POST' for wp_remote_post() 140 141 * - Default 'HEAD' for wp_remote_head() 141 * 'timeout' => 5 142 * 'redirection' => 5 143 * 'httpversion' => '1.0' 144 * 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) 145 * 'blocking' => true 146 * 'headers' => array() 147 * 'cookies' => array() 148 * 'body' => null 149 * 'compress' => false, 150 * 'decompress' => true, 151 * 'sslverify' => true, 152 * 'stream' => false, 153 * 'filename' => null 154 * 155 * @since 2.7.0 156 * 157 * @param string $url Site URL to retrieve. 158 * @param array $args Optional. Override the defaults. 142 * 143 * @since 2.7.0 144 * 145 * @see WP_Http::request() For additional information on default arguments. 146 * 147 * @param string $url Site URL to retrieve. 148 * @param array $args Optional. Request arguments. Default empty array. 159 149 * @return WP_Error|array The response or WP_Error on failure. 160 150 */ … … 167 157 * Retrieve the raw response from the HTTP request using the GET method. 168 158 * 169 * @see wp_remote_request() For more information on the response array format and default arguments. 170 * 171 * @since 2.7.0 172 * 173 * @param string $url Site URL to retrieve. 174 * @param array $args Optional. Override the defaults. 159 * @since 2.7.0 160 * 161 * @see wp_remote_request() For more information on the response array format. 162 * @see WP_Http::request() For default arguments information. 163 * 164 * @param string $url Site URL to retrieve. 165 * @param array $args Optional. Request arguments. Default empty array. 175 166 * @return WP_Error|array The response or WP_Error on failure. 176 167 */ … … 183 174 * Retrieve the raw response from the HTTP request using the POST method. 184 175 * 185 * @see wp_remote_request() For more information on the response array format and default arguments. 186 * 187 * @since 2.7.0 188 * 189 * @param string $url Site URL to retrieve. 190 * @param array $args Optional. Override the defaults. 176 * @since 2.7.0 177 * 178 * @see wp_remote_request() For more information on the response array format. 179 * @see WP_Http::request() For default arguments information. 180 * 181 * @param string $url Site URL to retrieve. 182 * @param array $args Optional. Request arguments. Default empty array. 191 183 * @return WP_Error|array The response or WP_Error on failure. 192 184 */ … … 199 191 * Retrieve the raw response from the HTTP request using the HEAD method. 200 192 * 201 * @see wp_remote_request() For more information on the response array format and default arguments. 202 * 203 * @since 2.7.0 204 * 205 * @param string $url Site URL to retrieve. 206 * @param array $args Optional. Override the defaults. 193 * @since 2.7.0 194 * 195 * @see wp_remote_request() For more information on the response array format. 196 * @see WP_Http::request() For default arguments information. 197 * 198 * @param string $url Site URL to retrieve. 199 * @param array $args Optional. Request arguments. Default empty array. 207 200 * @return WP_Error|array The response or WP_Error on failure. 208 201 */
Note: See TracChangeset
for help on using the changeset viewer.