Class HttpClientServicePostExtensions
Static object for HttpClientService extensions.
Inheritance
Inherited Members
Namespace: Geko.HttpClientService.Extensions
Assembly: Geko.HttpClientService.dll
Syntax
public static class HttpClientServicePostExtensions
Methods
| Improve this Doc View SourcePostAsync(HttpClientService, String, String)
Sends a POST request to the specified requestUri
using requestBody
as the body of the request.
Returns the response in the BodyAsString property.
Declaration
public static async Task<ResponseObject<string>> PostAsync(this HttpClientService httpClientService, string requestUri, string requestBody)
Parameters
Type | Name | Description |
---|---|---|
HttpClientService | httpClientService | The HttpClientService that gets extended. |
System.String | requestUri | A string representing the resource to be called. |
System.String | requestBody | The body of the request. |
Returns
Type | Description |
---|---|
Task<ResponseObject<System.String>> | A ResponseObject<TResponseBody> containing the body of the response
as |
PostAsync<TResponseBody>(HttpClientService, String, StreamContent)
Sends a POST request to the specified requestUri
using requestBody
as the body of the request.
Returns the response in the BodyAsType property.
Declaration
public static async Task<ResponseObject<TResponseBody>> PostAsync<TResponseBody>(this HttpClientService httpClientService, string requestUri, StreamContent requestBody)
Parameters
Type | Name | Description |
---|---|---|
HttpClientService | httpClientService | The HttpClientService that gets extended. |
System.String | requestUri | A string representing the resource to be called. |
StreamContent | requestBody | The body of the request. |
Returns
Type | Description |
---|---|
Task<ResponseObject<TResponseBody>> | A ResponseObject<TResponseBody> containing the body of the response
as |
Type Parameters
Name | Description |
---|---|
TResponseBody | The type of the property BodyAsType of the ResponseObject<TResponseBody> object,
that will contain the body of the response deserialized or casted to type
|
PostAsync<TResponseBody>(HttpClientService, String, StringContent)
Sends a POST request to the specified requestUri
using requestBody
as the body of the request.
Returns the response in the BodyAsString property.
Declaration
public static async Task<ResponseObject<TResponseBody>> PostAsync<TResponseBody>(this HttpClientService httpClientService, string requestUri, StringContent requestBody)
Parameters
Type | Name | Description |
---|---|---|
HttpClientService | httpClientService | The HttpClientService that gets extended. |
System.String | requestUri | A string representing the resource to be called. |
StringContent | requestBody | The body of the request. |
Returns
Type | Description |
---|---|
Task<ResponseObject<TResponseBody>> | A ResponseObject<TResponseBody> containing the body of the response
as |
Type Parameters
Name | Description |
---|---|
TResponseBody | The type of the property BodyAsType of the ResponseObject<TResponseBody> object,
that will contain the body of the response deserialized or casted to type
|
PostAsync<TResponseBody>(HttpClientService, String, String)
Sends a POST request to the specified requestUri
using requestBody
as the body of the request.
Returns the response in the BodyAsString property.
Declaration
public static async Task<ResponseObject<TResponseBody>> PostAsync<TResponseBody>(this HttpClientService httpClientService, string requestUri, string requestBody)
Parameters
Type | Name | Description |
---|---|---|
HttpClientService | httpClientService | The HttpClientService that gets extended. |
System.String | requestUri | A string representing the resource to be called. |
System.String | requestBody | The body of the request. |
Returns
Type | Description |
---|---|
Task<ResponseObject<TResponseBody>> | A ResponseObject<TResponseBody> containing the body of the response
as |
Type Parameters
Name | Description |
---|---|
TResponseBody | The type of the property BodyAsType of the ResponseObject<TResponseBody> object,
that will contain the body of the response deserialized or casted to type
|
PostAsync<TRequestBody, TResponseBody>(HttpClientService, String, TRequestBody)
Sends a POST request to the specified requestUri
using requestBody
as the body of the request
with TRequestBody
as the type of the requestBody
.
Returns the response wrapped in a ResponseObject<TResponseBody>.
String | in the BodyAsString property |
TResponseBody | in the BodyAsType property |
Stream | in the BodyAsStream property |
Declaration
public static async Task<ResponseObject<TResponseBody>> PostAsync<TRequestBody, TResponseBody>(this HttpClientService httpClientService, string requestUri, TRequestBody requestBody)
Parameters
Type | Name | Description |
---|---|---|
HttpClientService | httpClientService | The HttpClientService that gets extended. |
System.String | requestUri | A string representing the resource to be called. |
TRequestBody | requestBody | The body of the request. |
Returns
Type | Description |
---|---|
Task<ResponseObject<TResponseBody>> | A ResponseObject<TResponseBody> containing the body of the response
as
|
Type Parameters
Name | Description |
---|---|
TRequestBody | The type of the request body. The type used can be one of the following:
|
TResponseBody | The type of the property BodyAsType of the ResponseObject<TResponseBody> object,
that will contain the body of the response deserialized or casted to type
|