Show / Hide Table of Contents

Class HttpClientServicePutExtensions

Static object for HttpClientService extensions.

Inheritance
System.Object
HttpClientServicePutExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Geko.HttpClientService.Extensions
Assembly: Geko.HttpClientService.dll
Syntax
public static class HttpClientServicePutExtensions

Methods

| Improve this Doc View Source

PutAsync(HttpClientService, String, String)

Sends a PUT 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>> PutAsync(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 String in the BodyAsString property.

| Improve this Doc View Source

PutAsync<TResponseBody>(HttpClientService, String, StreamContent)

Sends a PUT 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>> PutAsync<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 String in the BodyAsString property.

Type Parameters
Name Description
TResponseBody
| Improve this Doc View Source

PutAsync<TResponseBody>(HttpClientService, String, StringContent)

Sends a PUT 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>> PutAsync<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 String in the BodyAsString property.

Type Parameters
Name Description
TResponseBody
| Improve this Doc View Source

PutAsync<TResponseBody>(HttpClientService, String, String)

Sends a PUT 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>> PutAsync<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 String in the BodyAsString property.

Type Parameters
Name Description
TResponseBody
| Improve this Doc View Source

PutAsync<TRequestBody, TResponseBody>(HttpClientService, String, TRequestBody)

Sends a PUT 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>> PutAsync<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 String in the BodyAsString property, as TResponseBody in the BodyAsType and, as Stream in the BodyAsStream property. The TResponseBody can be of the following:

  • Use to define Encoding and/or ContentType for an HTTP content based on string.
  • Use to provide HTTP content based on a stream.
  • A serializable complex typeAny serializable object to attempt to deserialize the body of the response to it.
  • A simple typeAny other simple type to try convert the body of the response to it.
Type Parameters
Name Description
TRequestBody

The type of the request body. The type used can be one of the following:

  • Use to define Encoding and/or ContentType for an HTTP content based on string.
  • Use to provide HTTP content based on a stream.
  • A serializable complex typeAny serializable object that will be serialized and sent in the body of the request.
  • A simple typeAny other simple type that will be sent in the body of the request.
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 TResponseBody. The type used can be one of the following:

  • Use to define Encoding and/or ContentType for an HTTP content based on string.
  • Use to provide HTTP content based on a stream.
  • A serializable complex typeAny serializable object to attempt to deserialize the body of the response to it.
  • A simple typeAny other simple type to try convert the body of the response to it.
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • PutAsync(HttpClientService, String, String)
    • PutAsync<TResponseBody>(HttpClientService, String, StreamContent)
    • PutAsync<TResponseBody>(HttpClientService, String, StringContent)
    • PutAsync<TResponseBody>(HttpClientService, String, String)
    • PutAsync<TRequestBody, TResponseBody>(HttpClientService, String, TRequestBody)
Back to top Generated by DocFX