Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
Open
Description
http.client.HTTPConnection and HTTPResponse lackrepr implementations, producing the default unhelpful object repr:
>>>importhttp.client>>>http.client.HTTPConnection('example.com')<http.client.HTTPConnectionobjectat0x...>
These should show useful state at a glance:
>>>http.client.HTTPConnection('example.com')<HTTPConnectionexample.com:80>>>>http.client.HTTPSConnection('example.com')<HTTPSConnectionexample.com:443>
And for responses:
>>>r=conn.getresponse()>>>r<HTTPResponse [200OK]>
The module already has arepr on IncompleteRead, so there's precedent. This would help when debugging HTTP code in the REPL or debugger.