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
HttpWebRequestThe request.
path
stringThe path.
DownloadToFile(HttpWebRequest?, string?, Uri?, bool)
Downloads to file.
public static void DownloadToFile(this HttpWebRequest? request, string? path, Uri? proxyLocation, bool bypassProxy)
Parameters
request
HttpWebRequestThe request.
path
stringThe path.
proxyLocation
UriThe proxy location.
bypassProxy
boolif set to
true
[bypass proxy].
DownloadToString(HttpWebRequest?)
Downloads to string.
public static string? DownloadToString(this HttpWebRequest? request)
Parameters
request
HttpWebRequestThe request.
Returns
DownloadToString(HttpWebRequest?, Uri?, bool)
Downloads to string.
public static string? DownloadToString(this HttpWebRequest? request, Uri? proxyLocation, bool bypassProxy)
Parameters
request
HttpWebRequestThe request.
proxyLocation
UriThe proxy location
bypassProxy
boolwhen
true
, bypass proxy
Returns
PostForm(HttpWebRequest?, Hashtable?)
Posts the form.
public static string? PostForm(this HttpWebRequest? request, Hashtable? postData)
Parameters
request
HttpWebRequestThe request.
postData
HashtableThe post data.
Returns
PostForm(HttpWebRequest?, Hashtable?, Uri?, bool)
Posts the form.
public static string? PostForm(this HttpWebRequest? request, Hashtable? postData, Uri? proxyLocation, bool bypassProxy)
Parameters
request
HttpWebRequestThe request.
postData
HashtableThe post data.
proxyLocation
UriThe proxy location.
bypassProxy
boolif set to
true
[bypass proxy].
Returns
PostXml(HttpWebRequest?, string?)
Posts the XML.
public static string? PostXml(this HttpWebRequest? request, string? xmlFragment)
Parameters
request
HttpWebRequestThe request.
xmlFragment
stringThe XML fragment.
Returns
PostXml(HttpWebRequest?, string?, Uri?, bool)
Posts the XML.
public static string? PostXml(this HttpWebRequest? request, string? xmlFragment, Uri? proxyLocation, bool bypassProxy)
Parameters
request
HttpWebRequestThe request.
xmlFragment
stringThe XML fragment.
proxyLocation
UriThe proxy location.
bypassProxy
boolif set to
true
[bypass proxy].
Returns
ToHttpStatusCode(HttpWebRequest?)
Converts the HttpWebRequest into a HTTP status code.
public static HttpStatusCode ToHttpStatusCode(this HttpWebRequest? request)
Parameters
request
HttpWebRequestThe request.
Returns
ToHttpWebResponse(HttpWebRequest?)
Converts the HttpWebRequest into a HTTP web response.
public static HttpWebResponse? ToHttpWebResponse(this HttpWebRequest? request)
Parameters
request
HttpWebRequestThe request.
Returns
WithProxy(HttpWebRequest?, Uri?, bool)
Returns the HttpWebRequest with a WebProxy.
public static HttpWebRequest? WithProxy(this HttpWebRequest? request, Uri? proxyLocation, bool bypassProxy)
Parameters
request
HttpWebRequestThe request.
proxyLocation
UriThe proxy location.
bypassProxy
boolif set to
true
[bypass proxy].
Returns
WithRequestBody(HttpWebRequest?, string?, string?)
Returns HttpWebRequest with the request body.
public static HttpWebRequest? WithRequestBody(this HttpWebRequest? request, string? requestBody, string? requestMethod)
Parameters
request
HttpWebRequestThe request.
requestBody
stringThe request body.
requestMethod
stringThe request method.
Returns
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
HttpWebRequestThe request.
requestBody
stringThe request body.
requestMethod
stringThe request method.
contentType
stringThe request content type.