RequestContext
Options that can be used to control the behavior of a request sent by a client.
The token to check for cancellation.
Controls under what conditions the operation raises an exception if the underlying response indicates a failure.
public RequestContext()
Initializes a new instance of the RequestContext class.
Initializes a new instance of the RequestContext class using the given ErrorOptions.
Customizes the ResponseClassifier for this operation to change
the default Response classification behavior so that it considers
the passed-in status code to be an error or not, as specified.
Status code classifiers are applied after all ResponseClassificationHandler classifiers.
This is useful for cases where you'd like to prevent specific response status codes from being treated as errors by
logging and distributed tracing policies -- that is, if a response is not classified as an error, it will not appear as an error in
logs or distributed traces.
Customizes the ResponseClassifier for this operation.
Adding a ResponseClassificationHandler changes the classification
behavior so that it first tries to classify a response via the handler, and if
the handler doesn't have an opinion, it instead uses the default classifier.
Handlers are applied in order so the most recently added takes precedence.
This is useful for cases where you'd like to prevent specific response status codes from being treated as errors by
logging and distributed tracing policies -- that is, if a response is not classified as an error, it will not appear as an error in
logs or distributed traces.
Adds an HttpPipelinePolicy into the pipeline for the duration of this request.
The position of policy in the pipeline is controlled by position parameter.
If you want the policy to execute once per client request use PerCall
otherwise use PerRetry to run the policy for every retry.