Click or drag to resize
GDHttpProtocolFilter Constructor
Creates a new instance of GDHttpProtocolFilter to be used with HttpClient.SendRequestAsync(HttpRequestMessage).

Namespace:  GD
Assembly:  GD (in GD.dll) Version: 255.255.255.255
Syntax
public GDHttpProtocolFilter()

Return Value

Type: 
Instance of GDHttpProtocolFilter.
Remarks
One instance of GDHttpProtocolFilter can be used to send many requests and will internally cache provided credentials.
Examples
The following example shows how to send HTTP request with authorization headers.
var protocolFilter = new GDHttpProtocolFilter();

var httpClient = new HttpClient(protocolFilter);
request = new HttpRequestMessage(HttpMethod.Get, new Uri("http://example.com"));

var username = "User";
var password = "Password";
buffer = CryptographicBuffer.ConvertStringToBinary(username + ":" + password, BinaryStringEncoding.Utf8);
base64token = CryptographicBuffer.EncodeToBase64String(buffer);
request.Headers.Authorization = new HttpCredentialsHeaderValue(GDAuthorizationMethod.Negotiate, base64token);

response = await httpClient.SendRequestAsync(request);
See Also