-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
gh-102327: Extend docs for "url" and "headers" parameters to HTTPConnection.request() #102328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
86275f8
Document "url" parameter to HTTPConnection.request() (#102327)
davidfstr 912df17
Alter example URL to be: https://docs.python.org/3/
davidfstr 9013cd3
Alter RFC section link to appear with more-natural formatting
davidfstr c0960c6
Distribute new documentation to relevant parameter paragraphs
davidfstr 231bd9e
Adjust formatting
davidfstr 5a6293d
Fix trailing whitespace
davidfstr e6dc07c
Clarify phrasing for when absolute paths are required
davidfstr dcf2480
Fix whitespace
davidfstr f6f6e48
Merge branch 'main' into f/http_url_clarify
merwok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line makes me wonder if
PUTandPATCHare part of «most HTTP methods», so I have to follow the RFC link to see. It seems that yes, onlyOPTIONS *is given as a counter-example. I wonder if there is a way to rephrase that so that casual readers take away that url should nearly always be an absolute path, see link for exact rules.What do other people think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more specific phrasing would be:
And further down:
A reader would still have to follow the link to determine the actual rules if they were talking to an HTTP proxy server (somewhat common?) or using
OPTIONS/CONNECT(rare?).Comments?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s very clear! The
unlessclause could even be in parentheses.I never use proxies but I think there are two cases:
GET https://authority/pathon a connection opened tohttp://proxyhttp_proxyorhttps_proxyenvironment variablesI suppose the note here applies to the first kind only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback applied. I think this change is ready to merge!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reply to the question about proxy? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RFC 2616 §1.3 defines a "proxy" as:
Therefore I speculate that the following requirement from §5.1.2 applies when a Python program attempts to connect to any kind of proxy:
I never use proxies myself so I have no empirical experience one way or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let’s hope the people using proxies know how to handle them!