Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fix `AnyUrl.build` doesn't do percent encoding (#3061) please review * Use `urllib.parse` instead of custom implementation for percent encoding * Make `quote_plus` a `stricturl` option * Add docs for `stricturl(quote_plus=True)` * Better changes message for #3061 Co-authored-by: Samuel Colvin <samcolvin@gmail.com> * Fix precent encoding version note to V1.10 Co-authored-by: Samuel Colvin <samcolvin@gmail.com> * Fix `Building URLs` snippit markdown Co-authored-by: Samuel Colvin <samcolvin@gmail.com> * Fix formatting for `docs/examples/types_url_building.py` * fix docs Co-authored-by: Samuel Colvin <samcolvin@gmail.com> Co-authored-by: Samuel Colvin <s@muelcolvin.com>
- Loading branch information
1 parent
ba58f94
commit e34ff92
Showing
5 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add percent encoding in `AnyUrl` and descendent types |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from pydantic import AnyUrl, stricturl | ||
|
||
url = AnyUrl.build(scheme='https', host='example.com', query='query=my query') | ||
print(url) | ||
|
||
my_url_builder = stricturl(quote_plus=True) | ||
url = my_url_builder.build( | ||
scheme='http', host='example.com', query='query=my query' | ||
) | ||
print(url) |
This file contains 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
This file contains 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
This file contains 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