MCPcopy
hub / github.com/aio-libs/aiohttp / update_path

Method update_path

aiohttp/client_reqrep.py:162–183  ·  view source on GitHub ↗

Build path.

(self, params)

Source from the content-addressed store, hash-verified

160 self.version = version
161
162 def update_path(self, params):
163 """Build path."""
164 # extract path
165 scheme, netloc, path, query, fragment = urllib.parse.urlsplit(self.url)
166 if not path:
167 path = '/'
168
169 if isinstance(params, collections.Mapping):
170 params = list(params.items())
171
172 if params:
173 if not isinstance(params, str):
174 params = urllib.parse.urlencode(params)
175 if query:
176 query = '%s&%s' % (query, params)
177 else:
178 query = params
179
180 self.path = urllib.parse.urlunsplit(('', '', helpers.requote_uri(path),
181 query, fragment))
182 self.url = urllib.parse.urlunsplit(
183 (scheme, netloc, self.path, '', ''))
184
185 def update_headers(self, headers):
186 """Update request headers."""

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected