requote_uri() — requests Function Reference
Architecture documentation for the requote_uri() function in utils.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD f46aaada_a38d_85e6_6125_21764bf29eda["requote_uri()"] 2c39b9da_e317_5e6c_bbac_8362bac2110c["utils.py"] f46aaada_a38d_85e6_6125_21764bf29eda -->|defined in| 2c39b9da_e317_5e6c_bbac_8362bac2110c 77892816_404a_4492_b558_b565f63d2ad0["prepare_url()"] 77892816_404a_4492_b558_b565f63d2ad0 -->|calls| f46aaada_a38d_85e6_6125_21764bf29eda cbf6862f_d124_817f_3342_f1142c276f25["resolve_redirects()"] cbf6862f_d124_817f_3342_f1142c276f25 -->|calls| f46aaada_a38d_85e6_6125_21764bf29eda 3ee84e71_4831_1957_cb26_fb2c39d96fe3["unquote_unreserved()"] f46aaada_a38d_85e6_6125_21764bf29eda -->|calls| 3ee84e71_4831_1957_cb26_fb2c39d96fe3 style f46aaada_a38d_85e6_6125_21764bf29eda fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/requests/utils.py lines 648–667
def requote_uri(uri):
"""Re-quote the given URI.
This function passes the given URI through an unquote/quote cycle to
ensure that it is fully and consistently quoted.
:rtype: str
"""
safe_with_percent = "!#$%&'()*+,/:;=?@[]~"
safe_without_percent = "!#$&'()*+,/:;=?@[]~"
try:
# Unquote only the unreserved characters
# Then quote only illegal characters (do not quote reserved,
# unreserved, or '%')
return quote(unquote_unreserved(uri), safe=safe_with_percent)
except InvalidURL:
# We couldn't unquote the given URI, so let's try quoting it, but
# there may be unquoted '%'s in the URI. We need to make sure they're
# properly quoted so they do not cause issues elsewhere.
return quote(uri, safe=safe_without_percent)
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does requote_uri() do?
requote_uri() is a function in the requests codebase, defined in src/requests/utils.py.
Where is requote_uri() defined?
requote_uri() is defined in src/requests/utils.py at line 648.
What does requote_uri() call?
requote_uri() calls 1 function(s): unquote_unreserved.
What calls requote_uri()?
requote_uri() is called by 2 function(s): prepare_url, resolve_redirects.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free