Requests icon indicating copy to clipboard operation
Requests copied to clipboard

[Question] How to get the data about the request that gets sent?

Open inl-pd-autotest opened this issue 7 years ago • 1 comments

$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?

inl-pd-autotest avatar Jul 07 '17 11:07 inl-pd-autotest

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.

toolbox1972 avatar Aug 23 '19 11:08 toolbox1972