Language

ApiVersionHandler Class

Definition

A delegating handler that adds the api-version query parameter to the request URI.

public class ApiVersionHandler : System.Net.Http.DelegatingHandler
type ApiVersionHandler = class
    inherit DelegatingHandler
Public Class ApiVersionHandler
Inherits DelegatingHandler
Inheritance
ApiVersionHandler

Constructors

Name Description
ApiVersionHandler(String)

Initializes a new instance of the ApiVersionHandler class with the optional API version.

Fields

Name Description
ApiVersion

The default API version to use if none is specified.

ApiVersionQueryString

The name of the query parameter used to specify the API version.

UserAgentHeader

The name of the User-Agent header.

UserAgentHeaderValue

The value of the User-Agent header, which includes the assembly name and version.

Methods

Name Description
SendAsync(HttpRequestMessage, CancellationToken)

Adds the api-version query parameter to the request URI if it is not already present.

Applies to