requests Module

This module is the requests implementation of Pipeline ABC

Classes

BasicRequestsHTTPSender

Implements a basic requests HTTP sender.

Since requests team recommends to use one session per requests, you should not consider this class as thread-safe, since it will use one Session per instance.

In this simple implementation:

  • You provide the configured session if you want to, or a basic session is created.
  • All kwargs received by "send" are sent to session.request directly
ClientRetryPolicy

Retry configuration settings. Container for retry policy object.

HTTPRequestsClientResponse
RequestHTTPSenderConfiguration

Requests specific HTTP sender configuration.

RequestsClientResponse
RequestsHTTPSender

A requests HTTP sender that can consume a msrest.Configuration object.

This instance will consume the following configuration attributes:

  • connection
  • proxies
  • retry_policy
  • redirect_policy
  • enable_http_logger
  • hooks
  • session_configuration_callback

Functions

default_session_configuration_callback

Configuration callback if you need to change default session configuration.

default_session_configuration_callback(session: requests.sessions.Session, global_config: msrest.universal_http.requests.RequestHTTPSenderConfiguration, local_config: Dict[str, str], **kwargs: str) -> Dict[str, str]

Parameters

session
<xref:requests.Session>
Required

The session.

global_config
Configuration
Required

The global configuration.

local_config
dict[<xref:str,str>]
Required

The on-the-fly configuration passed on the call.

kwargs
dict[<xref:str,str>]
Required

The current computed values for session.request method.

Returns

Must return kwargs, to be passed to session.request. If None is return, initial kwargs will be used.

Return type

dict[<xref:str,str>]