Opened 9 years ago
Closed 9 years ago
#37081 closed defect (bug) (fixed)
Requests: http_api_debug parameter no longer accurate
Reported by: | johnbillion | Owned by: | rmccue |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | HTTP API | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The $class
parameter that's passed to the http_api_debug
action is supposed to represent the name of the transport class used for the request. Since the introduction of the Requests
library, this is no longer the case. The string Requests
is passed instead. This means debugging tools that hook into http_api_debug
can no longer determine which transport was used.
In addition, the http_api_debug
action is documented in two separate places.
Change History (3)
Note: See
TracTickets for help on using
tickets.
From WordPress' perspective, the transport is Requests, which is why I set it to that. (Also avoids bad plugins assuming that they can use a class based on the transport.) Requests exposes the transport it's using via Requests::get_transport(), unless it has been overridden in the options passed in.
Right now, there's no way of getting the transport that was used for a request back out. We could save the options on the response object, but that seems like it could easily cause a memory leak.
Any ideas how best to handle this?