MCPcopy
hub / github.com/psf/requests / __init__

Method __init__

src/requests/sessions.py:442–503  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

440 ]
441
442 def __init__(self) -> None:
443 #: A case-insensitive dictionary of headers to be sent on each
444 #: :class:`Request <Request>` sent from this
445 #: :class:`Session <Session>`.
446 self.headers = default_headers()
447
448 #: Default Authentication tuple or object to attach to
449 #: :class:`Request <Request>`.
450 self.auth = None
451
452 #: Dictionary mapping protocol or protocol and host to the URL of the proxy
453 #: (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) to
454 #: be used on each :class:`Request <Request>`.
455 self.proxies = {}
456
457 #: Event-handling hooks.
458 self.hooks = default_hooks()
459
460 #: Dictionary of querystring data to attach to each
461 #: :class:`Request <Request>`. The dictionary values may be lists for
462 #: representing multivalued query parameters.
463 self.params = {}
464
465 #: Stream response content default.
466 self.stream = False
467
468 #: SSL Verification default.
469 #: Defaults to `True`, requiring requests to verify the TLS certificate at the
470 #: remote end.
471 #: If verify is set to `False`, requests will accept any TLS certificate
472 #: presented by the server, and will ignore hostname mismatches and/or
473 #: expired certificates, which will make your application vulnerable to
474 #: man-in-the-middle (MitM) attacks.
475 #: Only set this to `False` for testing.
476 #: If verify is set to a string, it must be the path to a CA bundle file
477 #: that will be used to verify the TLS certificate.
478 self.verify = True
479
480 #: SSL client certificate default, if String, path to ssl client
481 #: cert file (.pem). If Tuple, ('cert', 'key') pair.
482 self.cert = None
483
484 #: Maximum number of redirects allowed. If the request exceeds this
485 #: limit, a :class:`TooManyRedirects` exception is raised.
486 #: This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is
487 #: 30.
488 self.max_redirects = DEFAULT_REDIRECT_LIMIT
489
490 #: Trust environment settings for proxy configuration, default
491 #: authentication and similar.
492 self.trust_env = True
493
494 #: A CookieJar containing all currently outstanding cookies set on this
495 #: session. By default it is a
496 #: :class:`RequestsCookieJar <requests.cookies.RequestsCookieJar>`, but
497 #: may be any other ``cookielib.CookieJar`` compatible object.
498 self.cookies = cookiejar_from_dict({})
499

Callers

nothing calls this directly

Calls 5

mountMethod · 0.95
default_headersFunction · 0.85
default_hooksFunction · 0.85
cookiejar_from_dictFunction · 0.85
HTTPAdapterClass · 0.85

Tested by

no test coverage detected