Here are my current working notes on our remaining 1.0 items...
HTTPX 1.0
Minor:
httpx.StatusCodes in favour of httpx.codes. See #1088PoolLimits -> Limits, pool_limits -> limits..call_next might need to be private. .timer might need looking at.httpx.create_ssl_context(...) - See https://github.com/encode/httpx/issues/983Not strictly required, but worth looking at:
rfc3986 vs. irl vs. urlcore. - See https://github.com/encode/httpx/issues/328#issuecomment-664253854httpcore API required to support them.Here's a high-level API reference...
request, stream, get, options, head, post, put, patch, delete
Client, AsyncClient
Response, Request, URL, QueryParams, Headers, Cookies
Limits, Proxy, Timeout
Auth, BasicAuth, DigestAuth
ASGITransport, WSGITransport
codes
RequestError All exceptions that can occur during a .request()TransportError These all have counterparts in httpcoreTimeoutExceptionConnectTimeoutReadTimeoutWriteTimeoutPoolTimeoutNetworkErrorConnectErrorReadErrorWriteErrorCloseErrorProxyErrorProtocolErrorDecodingErrorContentDecodingErrorTextDecodingErrorTooManyRedirectsRequestBodyUnavailableInvalidURLHTTPStatusError - Occurs during .raise_for_statusNotRedirectResponse - Occurs if calling .next() without properly checking .is_redirect_responseCookieConflict - Can occur with response.cookies.get(...)StreamErrorStreamConsumed - Occurs if attempting to iterate over the stream twiceResponseNotRead - Occurs if accessing .content without having .read() the streamRequestNotRead - Occurs if accessing .content without having .read() the streamResponseClosed - Occurs if attempting to read the stream after response is already closedHere's how our lovely & minimal core non-optional dependancies would look...
Depending on our assessment of https://github.com/encode/httpx/issues/328#issuecomment-664253854
httpcoreh11sniffiorfc3986idnacertifiGonna put in another request for built-in retries, though I understand if the answer is still "no" or "not for 1.0".
Went ahead and created https://github.com/encode/httpx/issues/1102 to better track the "Drop HSTS" item - also updated the description here.
@StephenBrown2 Fair question yup, seems to me that it's absolutely a 1.1 item. It's a great feature that we should look at, but I don't think there's any pressing need for it to block a release marked as 1.0, with the API stability that implies.
@StephenBrown2 Want to open an issue for retries so we can start discussing the API, and finer details of the expected behaviours? Even tho it's not strictly a 1.0 blocker, perhaps it's feasible it might still land in time for that.
Useful initial points to discuss:
requests provides for retries. (I think you need to mount an adapter in order to get retry support right?)requests uses through urllib3, when enabled without providing any finer-tuning details?urlilb3 offer in it's Retry config class?Also I think there鈥檚 lots of useful context and ideas already starting from #784 :-)
No adapter required - the idea was to loop around send_single_request() (I think?) in case of connection failures. The PR stopped at handling network errors only (so no retries on HTTP status errors or stuff like that) and I think there was a rationale behind that, but don鈥檛 have the exact thing off the top of my mind.
The original issue is https://github.com/encode/httpx/issues/108 (gosh, over 900 Issues/PRs ago). I can try to summarize in a bit, but @florimondmanca is right, the interface is just a parameter to the client or requester, similar to the Timeout we've got now. However, https://github.com/encode/httpx/pull/778 had a good idea with a retry_flow method to overwrite, similar to the auth_flow method httpx also has now.
Closing this one off, since I think everything we need to track is appropriately milestoned now.
Most helpful comment
@StephenBrown2 Want to open an issue for retries so we can start discussing the API, and finer details of the expected behaviours? Even tho it's not strictly a 1.0 blocker, perhaps it's feasible it might still land in time for that.
Useful initial points to discuss:
requestsprovides for retries. (I think you need to mount an adapter in order to get retry support right?)requestsuses throughurllib3, when enabled without providing any finer-tuning details?urlilb3offer in it'sRetryconfig class?