CustomHookPolicy Class

A simple policy that enable the given callback with the response.

Inheritance
azure.core.pipeline.policies._base.SansIOHTTPPolicy
CustomHookPolicy

Constructor

CustomHookPolicy(**kwargs)

Parameters

raw_request_hook
<xref:callback>

Callback function. Will be invoked on request.

raw_response_hook
<xref:callback>

Callback function. Will be invoked on response.

Methods

on_request

This is executed before sending the request to the next policy.

on_response

This is executed after the request comes back from the policy.

on_request

This is executed before sending the request to the next policy.

on_request(request: azure.core.pipeline.PipelineRequest) -> None

Parameters

request
PipelineRequest
Required

The PipelineRequest object.

on_response

This is executed after the request comes back from the policy.

on_response(request: azure.core.pipeline.PipelineRequest, response: azure.core.pipeline.PipelineResponse) -> None

Parameters

request
PipelineRequest
Required

The PipelineRequest object.

response
PipelineResponse
Required

The PipelineResponse object.