Table of Contents

Class HttpWebRequestExtensions

Namespace
Songhay.Extensions
Assembly
SonghayCore.dll

Extensions of HttpWebRequest

public static class HttpWebRequestExtensions
Inheritance
HttpWebRequestExtensions
Inherited Members

Methods

DownloadToFile(HttpWebRequest?, string?)

Downloads to file.

public static void DownloadToFile(this HttpWebRequest? request, string? path)

Parameters

request HttpWebRequest

The request.

path string

The path.

DownloadToFile(HttpWebRequest?, string?, Uri?, bool)

Downloads to file.

public static void DownloadToFile(this HttpWebRequest? request, string? path, Uri? proxyLocation, bool bypassProxy)

Parameters

request HttpWebRequest

The request.

path string

The path.

proxyLocation Uri

The proxy location.

bypassProxy bool

if set to true [bypass proxy].

DownloadToString(HttpWebRequest?)

Downloads to string.

public static string? DownloadToString(this HttpWebRequest? request)

Parameters

request HttpWebRequest

The request.

Returns

string

DownloadToString(HttpWebRequest?, Uri?, bool)

Downloads to string.

public static string? DownloadToString(this HttpWebRequest? request, Uri? proxyLocation, bool bypassProxy)

Parameters

request HttpWebRequest

The request.

proxyLocation Uri

The proxy location

bypassProxy bool

when true, bypass proxy

Returns

string

PostForm(HttpWebRequest?, Hashtable?)

Posts the form.

public static string? PostForm(this HttpWebRequest? request, Hashtable? postData)

Parameters

request HttpWebRequest

The request.

postData Hashtable

The post data.

Returns

string

PostForm(HttpWebRequest?, Hashtable?, Uri?, bool)

Posts the form.

public static string? PostForm(this HttpWebRequest? request, Hashtable? postData, Uri? proxyLocation, bool bypassProxy)

Parameters

request HttpWebRequest

The request.

postData Hashtable

The post data.

proxyLocation Uri

The proxy location.

bypassProxy bool

if set to true [bypass proxy].

Returns

string

PostXml(HttpWebRequest?, string?)

Posts the XML.

public static string? PostXml(this HttpWebRequest? request, string? xmlFragment)

Parameters

request HttpWebRequest

The request.

xmlFragment string

The XML fragment.

Returns

string

PostXml(HttpWebRequest?, string?, Uri?, bool)

Posts the XML.

public static string? PostXml(this HttpWebRequest? request, string? xmlFragment, Uri? proxyLocation, bool bypassProxy)

Parameters

request HttpWebRequest

The request.

xmlFragment string

The XML fragment.

proxyLocation Uri

The proxy location.

bypassProxy bool

if set to true [bypass proxy].

Returns

string

ToHttpStatusCode(HttpWebRequest?)

Converts the HttpWebRequest into a HTTP status code.

public static HttpStatusCode ToHttpStatusCode(this HttpWebRequest? request)

Parameters

request HttpWebRequest

The request.

Returns

HttpStatusCode

ToHttpWebResponse(HttpWebRequest?)

Converts the HttpWebRequest into a HTTP web response.

public static HttpWebResponse? ToHttpWebResponse(this HttpWebRequest? request)

Parameters

request HttpWebRequest

The request.

Returns

HttpWebResponse

WithProxy(HttpWebRequest?, Uri?, bool)

Returns the HttpWebRequest with a WebProxy.

public static HttpWebRequest? WithProxy(this HttpWebRequest? request, Uri? proxyLocation, bool bypassProxy)

Parameters

request HttpWebRequest

The request.

proxyLocation Uri

The proxy location.

bypassProxy bool

if set to true [bypass proxy].

Returns

HttpWebRequest

WithRequestBody(HttpWebRequest?, string?, string?)

Returns HttpWebRequest with the request body.

public static HttpWebRequest? WithRequestBody(this HttpWebRequest? request, string? requestBody, string? requestMethod)

Parameters

request HttpWebRequest

The request.

requestBody string

The request body.

requestMethod string

The request method.

Returns

HttpWebRequest

WithRequestBody(HttpWebRequest?, string?, string?, string?)

Returns HttpWebRequest with the request body.

public static HttpWebRequest? WithRequestBody(this HttpWebRequest? request, string? requestBody, string? requestMethod, string? contentType)

Parameters

request HttpWebRequest

The request.

requestBody string

The request body.

requestMethod string

The request method.

contentType string

The request content type.

Returns

HttpWebRequest