Skip to content

Instantly share code, notes, and snippets.

@tott
Created May 22, 2019 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tott/d3842c7472133e27d44c7697b601258b to your computer and use it in GitHub Desktop.
Save tott/d3842c7472133e27d44c7697b601258b to your computer and use it in GitHub Desktop.
debug_http_requests.php Debug WordPress http api requests
<?php
add_action( 'http_api_debug', 'my_http_api_debug', 10, 5 );
function my_http_api_debug( $response, $type, $class, $args, $url ) {
error_log( 'requested url: ' . var_export( $url, true ) );
error_log( 'arguments: ' . var_export( $args, true ) );
error_log( 'http response : ' . var_export( $response, true ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment