debug
- Summary
Set totrue
or set to a PHP stream returned byfopen()
toenable debug output with the handler used to send a request. For example,when using cURL to transfer requests, cURL's verbose ofCURLOPT_VERBOSE
will be emitted. When using the PHP stream wrapper, stream wrappernotifications will be emitted. If set to true, the output is written toPHP's STDOUT. If a PHP stream is provided, output is written to the stream.- Types
- bool
-fopen()
resource- Default
None- Constant
GuzzleHttp\RequestOptions::DEBUG
- $client->request('GET', '/get', ['debug' => true]);
Running the above example would output something like the following:
- * About to connect() to httpbin.org port 80 (#0)
- * Trying 107.21.213.98... * Connected to httpbin.org (107.21.213.98) port 80 (#0)
- > GET /get HTTP/1.1
- Host: httpbin.org
- User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7
- < HTTP/1.1 200 OK
- < Access-Control-Allow-Origin: *
- < Content-Type: application/json
- < Date: Sun, 16 Feb 2014 06:50:09 GMT
- < Server: gunicorn/0.17.4
- < Content-Length: 335
- < Connection: keep-alive
- <
- * Connection #0 to host httpbin.org left intact