Title: wp-includes/http.php | Developer.WordPress.org

---

# File: wp-includes/http.php

 * hook[http_allowed_safe_ports](https://developer.wordpress.org/reference/hooks/http_allowed_safe_ports/)
 * Controls the list of ports considered safe in HTTP API.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/http_allowed_safe_ports/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/http_allowed_safe_ports/#uses)
   | Source: [wp-includes/http.php:660](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L660-L660)
 * function[_wp_translate_php_url_constant_to_key()](https://developer.wordpress.org/reference/functions/_wp_translate_php_url_constant_to_key/)
 * Translates a PHP_URL_* constant to the named array keys PHP uses.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/_wp_translate_php_url_constant_to_key/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/functions/_wp_translate_php_url_constant_to_key/#uses)
   | Source: [wp-includes/http.php:867](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L867-L880)
 * function[_get_component_from_parsed_url_array()](https://developer.wordpress.org/reference/functions/_get_component_from_parsed_url_array/)
 * Retrieves a specific component from a parsed URL array.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/_get_component_from_parsed_url_array/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/_get_component_from_parsed_url_array/#uses)
   | Source: [wp-includes/http.php:838](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L838-L849)
 * function[wp_parse_url()](https://developer.wordpress.org/reference/functions/wp_parse_url/)
 * A wrapper for PHP’s parse_url() function that handles consistency in the return
   values across PHP versions.
 * Used by [32 functions](https://developer.wordpress.org/reference/functions/wp_parse_url/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_parse_url/#uses)
   | Source: [wp-includes/http.php:761](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L761-L787)
 * function[wp_remote_retrieve_cookie_value()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie_value/)
 * Retrieves a single cookie’s value by name from the raw response.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie_value/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie_value/#uses)
   | Source: [wp-includes/http.php:377](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L377-L385)
 * function[wp_remote_retrieve_cookies()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookies/)
 * Retrieves only the cookies from the raw response.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookies/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookies/#uses)
   | Source: [wp-includes/http.php:333](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L333-L339)
 * function[wp_remote_retrieve_cookie()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie/)
 * Retrieves a single cookie by name from the raw response.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_cookie/#uses)
   | Source: [wp-includes/http.php:351](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L351-L365)
 * hook[allowed_http_origins](https://developer.wordpress.org/reference/hooks/allowed_http_origins/)
 * Changes the origin types allowed for HTTP requests.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/allowed_http_origins/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/allowed_http_origins/#uses)
   | Source: [wp-includes/http.php:469](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L469-L469)
 * function[is_allowed_http_origin()](https://developer.wordpress.org/reference/functions/is_allowed_http_origin/)
 * Determines if the HTTP origin is an authorized one.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/is_allowed_http_origin/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/is_allowed_http_origin/#uses)
   | Source: [wp-includes/http.php:480](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L480-L500)
 * hook[allowed_http_origin](https://developer.wordpress.org/reference/hooks/allowed_http_origin/)
 * Changes the allowed HTTP origin result.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/allowed_http_origin/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/allowed_http_origin/#uses)
   | Source: [wp-includes/http.php:499](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L499-L499)
 * function[send_origin_headers()](https://developer.wordpress.org/reference/functions/send_origin_headers/)
 * Sends Access-Control-Allow-Origin and related headers if the current request 
   is from an allowed origin.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/send_origin_headers/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/send_origin_headers/#uses)
   | Source: [wp-includes/http.php:515](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L515-L533)
 * function[wp_http_validate_url()](https://developer.wordpress.org/reference/functions/wp_http_validate_url/)
 * Validates a URL as safe for use in the HTTP API.
 * Used by [8 functions](https://developer.wordpress.org/reference/functions/wp_http_validate_url/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/wp_http_validate_url/#uses)
   | Source: [wp-includes/http.php:559](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L559-L670)
 * hook[http_request_host_is_external](https://developer.wordpress.org/reference/hooks/http_request_host_is_external/)
 * Checks if HTTP request is external or not.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/http_request_host_is_external/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/http_request_host_is_external/#uses)
   | Source: [wp-includes/http.php:635](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L635-L635)
 * function[allowed_http_request_hosts()](https://developer.wordpress.org/reference/functions/allowed_http_request_hosts/)
 * Marks allowed redirect hosts safe for HTTP requests as well.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/allowed_http_request_hosts/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/allowed_http_request_hosts/#uses)
   | Source: [wp-includes/http.php:683](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L683-L688)
 * function[ms_allowed_http_request_hosts()](https://developer.wordpress.org/reference/functions/ms_allowed_http_request_hosts/)
 * Adds any domain in a multisite installation for safe HTTP requests to the allowed
   list.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/ms_allowed_http_request_hosts/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/ms_allowed_http_request_hosts/#uses)
   | Source: [wp-includes/http.php:704](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L704-L718)
 * function[get_http_origin()](https://developer.wordpress.org/reference/functions/get_http_origin/)
 * Gets the HTTP Origin of the current request.
 * Used by [3 functions](https://developer.wordpress.org/reference/functions/get_http_origin/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/get_http_origin/#uses)
   | Source: [wp-includes/http.php:425](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L425-L439)
 * function[_wp_http_get_object()](https://developer.wordpress.org/reference/functions/_wp_http_get_object/)
 * Returns the initialized WP_Http Object
 * Used by [8 functions](https://developer.wordpress.org/reference/functions/_wp_http_get_object/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/functions/_wp_http_get_object/#uses)
   | Source: [wp-includes/http.php:20](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L20-L27)
 * hook[http_origin](https://developer.wordpress.org/reference/hooks/http_origin/)
 * Changes the origin of an HTTP request.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/http_origin/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/http_origin/#uses)
   | Source: [wp-includes/http.php:438](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L438-L438)
 * function[wp_safe_remote_request()](https://developer.wordpress.org/reference/functions/wp_safe_remote_request/)
 * Retrieves the raw response from a safe HTTP request.
 * Used by [6 functions](https://developer.wordpress.org/reference/functions/wp_safe_remote_request/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_safe_remote_request/#uses)
   | Source: [wp-includes/http.php:52](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L52-L56)
 * function[get_allowed_http_origins()](https://developer.wordpress.org/reference/functions/get_allowed_http_origins/)
 * Retrieves list of allowed HTTP origins.
 * Used by [1 function](https://developer.wordpress.org/reference/functions/get_allowed_http_origins/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/functions/get_allowed_http_origins/#uses)
   | Source: [wp-includes/http.php:448](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L448-L470)
 * function[wp_safe_remote_get()](https://developer.wordpress.org/reference/functions/wp_safe_remote_get/)
 * Retrieves the raw response from a safe HTTP request using the GET method.
 * Used by [8 functions](https://developer.wordpress.org/reference/functions/wp_safe_remote_get/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_safe_remote_get/#uses)
   | Source: [wp-includes/http.php:81](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L81-L85)
 * function[wp_safe_remote_post()](https://developer.wordpress.org/reference/functions/wp_safe_remote_post/)
 * Retrieves the raw response from a safe HTTP request using the POST method.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/wp_safe_remote_post/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_safe_remote_post/#uses)
   | Source: [wp-includes/http.php:110](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L110-L114)
 * function[wp_safe_remote_head()](https://developer.wordpress.org/reference/functions/wp_safe_remote_head/)
 * Retrieves the raw response from a safe HTTP request using the HEAD method.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/wp_safe_remote_head/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_safe_remote_head/#uses)
   | Source: [wp-includes/http.php:139](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L139-L143)
 * function[wp_remote_request()](https://developer.wordpress.org/reference/functions/wp_remote_request/)
 * Performs an HTTP request and returns its response.
 * Used by [2 functions](https://developer.wordpress.org/reference/functions/wp_remote_request/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_request/#uses)
   | Source: [wp-includes/http.php:166](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L166-L169)
 * function[wp_remote_get()](https://developer.wordpress.org/reference/functions/wp_remote_get/)
 * Performs an HTTP request using the GET method and returns its response.
 * Used by [20 functions](https://developer.wordpress.org/reference/functions/wp_remote_get/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_get/#uses)
   | Source: [wp-includes/http.php:187](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L187-L190)
 * function[wp_remote_post()](https://developer.wordpress.org/reference/functions/wp_remote_post/)
 * Performs an HTTP request using the POST method and returns its response.
 * Used by [9 functions](https://developer.wordpress.org/reference/functions/wp_remote_post/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_post/#uses)
   | Source: [wp-includes/http.php:208](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L208-L211)
 * function[wp_remote_head()](https://developer.wordpress.org/reference/functions/wp_remote_head/)
 * Performs an HTTP request using the HEAD method and returns its response.
 * Used by [0 functions](https://developer.wordpress.org/reference/functions/wp_remote_head/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_head/#uses)
   | Source: [wp-includes/http.php:229](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L229-L232)
 * function[wp_remote_retrieve_headers()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_headers/)
 * Retrieves only the headers from the raw response.
 * Used by [5 functions](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_headers/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_headers/#uses)
   | Source: [wp-includes/http.php:246](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L246-L252)
 * function[wp_remote_retrieve_header()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_header/)
 * Retrieves a single header by name from the raw response.
 * Used by [4 functions](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_header/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_header/#uses)
   | Source: [wp-includes/http.php:264](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L264-L270)
 * function[wp_remote_retrieve_response_code()](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_response_code/)
 * Retrieves only the response code from the raw response.
 * Used by [24 functions](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_response_code/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/functions/wp_remote_retrieve_response_code/#uses)
   | Source: [wp-includes/http.php:282](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/http.php#L282-L288)

1 [2](https://developer.wordpress.org/reference/file/wp-includes/http.php/page/2/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/file/wp-includes/http.php/page/2/?output_format=md)