Show / Hide Table of Contents

Class HttpClientServiceHeadExtensions

Static object for HttpClientService extensions.

Inheritance
System.Object
HttpClientServiceHeadExtensions
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 HttpClientServiceHeadExtensions

Methods

| Improve this Doc View Source

HeadAsync(HttpClientService, String)

Sends a HEAD request to the specified requestUri and returns the response wrapped in a ResponseObject<TResponseBody> in an asynchronous operation.

Declaration
public static async Task<ResponseObject<string>> HeadAsync(this HttpClientService httpClientService, string requestUri)
Parameters
Type Name Description
HttpClientService httpClientService

The HttpClientService that gets extended

System.String requestUri

A string representing the resource to be called

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

HeadAsync<TResponseBody>(HttpClientService, String)

Sends a HEAD request to the specified requestUri and returns the response wrapped in a ResponseObject<TResponseBody> in an asynchronous operation.

String in the BodyAsString property
TResponseBody in the BodyAsType property
Stream in the BodyAsStream property
Declaration
public static async Task<ResponseObject<TResponseBody>> HeadAsync<TResponseBody>(this HttpClientService httpClientService, string requestUri)
Parameters
Type Name Description
HttpClientService httpClientService

The HttpClientService that gets extended

System.String requestUri

A string representing the resource to be called

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
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
Back to top Generated by DocFX