Class Extensions
Provides a set of extension methods for working with URIs and HTTP requests.
Inherited Members
Namespace: Innovt.Core.Http
Assembly: Innovt.Core.dll
Syntax
public static class Extensions
Methods
| Edit this page View SourceAddBody(HttpWebRequest, string)
Adds a request body to an HTTP request.
Declaration
public static HttpWebRequest AddBody(this HttpWebRequest request, string dataToSend)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpWebRequest | request | The HTTP request to which the body will be added. |
| string | dataToSend | The data to include in the request body. |
Returns
| Type | Description |
|---|---|
| HttpWebRequest | The modified HTTP request with the added request body. |
AddHeader(HttpWebRequest, NameValueCollection)
Adds headers to an HTTP request.
Declaration
public static HttpWebRequest AddHeader(this HttpWebRequest request, NameValueCollection headerData)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpWebRequest | request | The HTTP request to which headers will be added. |
| NameValueCollection | headerData | The collection of headers to add to the request. |
Returns
| Type | Description |
|---|---|
| HttpWebRequest | The modified HTTP request with added headers. |
AppendResourceUri(Uri, string)
Appends a resource path to the base URI.
Declaration
public static Uri AppendResourceUri(this Uri baseUri, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | baseUri | The base URI to which the resource path will be appended. |
| string | resource | The resource path to append. |
Returns
| Type | Description |
|---|---|
| Uri | A new URI containing the base URI with the appended resource path. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if the baseUri is null. |
| Exception | Thrown if the URL cannot be created. |