SansIOHTTPPolicy Class

Represents a sans I/O policy.

SansIOHTTPPolicy is a base class for policies that only modify or mutate a request based on the HTTP specification, and do not depend on the specifics of any particular transport. SansIOHTTPPolicy subclasses will function in either a Pipeline or an AsyncPipeline, and can act either before the request is done, or after. You can optionally make these methods coroutines (or return awaitable objects) but they will then be tied to AsyncPipeline usage.

Constructor

SansIOHTTPPolicy()

Methods

on_request

Is executed before sending the request from next policy.

on_response

Is executed after the request comes back from the policy.

on_request

Is executed before sending the request from next policy.

on_request(request: PipelineRequest[HTTPRequestType]) -> None | Awaitable[None]

Parameters

Name Description
request
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineRequest>>

Request to be modified before sent from next policy.

on_response

Is executed after the request comes back from the policy.

on_response(request: PipelineRequest[HTTPRequestType], response: PipelineResponse[HTTPRequestType, HTTPResponseType]) -> None | Awaitable[None]

Parameters

Name Description
request
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineRequest>>

Request to be modified after returning from the policy.

response
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineResponse>>

Pipeline response object