feat: add HTTP client foundation and configuration - #14546
Open
algebraic-dev wants to merge 5 commits into
Open
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
…ia/async-http-client-config
This was referenced Jul 27, 2026
Closed
TwoFX
reviewed
Jul 30, 2026
Comment on lines
+205
to
+214
| /-- | ||
| When `true`, automatic redirect following is restricted to requests whose | ||
| original method is safe (RFC 9110 §9.2.1: GET, HEAD, OPTIONS, TRACE). | ||
| Redirects for unsafe methods (POST, PUT, DELETE, PATCH, …) are not followed | ||
| automatically — the response is returned as-is for the caller to handle. | ||
|
|
||
| Defaults to `false` so that the standard 301/302 POST→GET downgrade and | ||
| 307/308 method-preserving redirects work out of the box. | ||
| -/ | ||
| onlySafeRedirects : Bool := false |
Member
There was a problem hiding this comment.
Is there a specific motivation for this feature? Is it inspired by an HTTP client in a different language?
Either way, the semantics seem debatable here. It seems that if we're downgrading anyway, then following the redirect should be fine.
Member
Author
There was a problem hiding this comment.
I think that's good for avoiding repeating the redirect when something has a non-idempotent method, like payments or things like that, where we can't allow the operation to happen twice. Maybe I should change it to a validation function that runs on every redirect and decides whether it should change like in golang.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the basic structure for the HTTP client, including client configuration, possible errors, and small changes to other modules.