MCPcopy Create free account
hub / github.com/oauthlib/oauthlib / Request

Class Request

oauthlib/common.py:331–433  ·  view source on GitHub ↗

A malleable representation of a signable HTTP request. Body argument may contain any data, but parameters will only be decoded if they are one of: * urlencoded query string * dict * list of 2-tuples Anything else will be treated as raw body data to be passed through un

Source from the content-addressed store, hash-verified

329
330
331class Request:
332
333 """A malleable representation of a signable HTTP request.
334
335 Body argument may contain any data, but parameters will only be decoded if
336 they are one of:
337
338 * urlencoded query string
339 * dict
340 * list of 2-tuples
341
342 Anything else will be treated as raw body data to be passed through
343 unmolested.
344 """
345
346 def __init__(self, uri, http_method='GET', body=None, headers=None,
347 encoding='utf-8'):
348 # Convert to unicode using encoding if given, else assume unicode
349 def encode(x):
350 return to_unicode(x, encoding) if encoding else x
351
352 self.uri = encode(uri)
353 self.http_method = encode(http_method)
354 self.headers = CaseInsensitiveDict(encode(headers or {}))
355 self.body = encode(body)
356 self.decoded_body = extract_params(self.body)
357 self.oauth_params = []
358 self.validator_log = {}
359
360 self._params = {
361 "access_token": None,
362 "client": None,
363 "client_id": None,
364 "client_secret": None,
365 "code": None,
366 "code_challenge": None,
367 "code_challenge_method": None,
368 "code_verifier": None,
369 "extra_credentials": None,
370 "grant_type": None,
371 "redirect_uri": None,
372 "refresh_token": None,
373 "request_token": None,
374 "response_type": None,
375 "scope": None,
376 "scopes": None,
377 "state": None,
378 "token": None,
379 "user": None,
380 "token_type_hint": None,
381
382 # OpenID Connect
383 "response_mode": None,
384 "nonce": None,
385 "display": None,
386 "prompt": None,
387 "claims": None,
388 "max_age": None,

Callers 15

verify_requestMethod · 0.90
create_token_responseMethod · 0.90
signMethod · 0.90
_create_requestMethod · 0.90
test_none_bodyMethod · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…