Requests
Requests copied to clipboard
[Question] How to get the data about the request that gets sent?
$domain_URL = 'http://some.url.com/';
$event_relative_URL = '/relative/path/';
$session = new Requests_Session($domain_URL);
$response = $session->get($event_relative_URL);
$requestURL = '/api?something=here&and=there'
$payload = {[...]} // some data there
And now I need to do
$response = $session->post($requestURL, [], json_encode($payload))
but I'd like to debug how the outgoing request looks like. How to do that?
Not sure if it is possible in [Requests] but you can always fall back to plain curl, and use "-v" for verbose. If that is not enough info you can replace the "-v" with --trace-ascii.