Skip to main content

Class GetRequest<TOut>

Namespace: Consul
Assembly: Consul.dll

Performs a GET to API endpoints in Consul, returning a generic type

public class GetRequest<TOut> : ConsulRequest

Type Parameters

TOut

A generic type to be deserialised and returned

Inheritance

objectConsulRequestGetRequest<TOut>

Inherited Members

ConsulRequest.ApplyOptions(ConsulClientConfiguration) , ConsulRequest.ApplyHeaders(HttpRequestMessage, ConsulClientConfiguration) , ConsulRequest.BuildConsulUri(string, Dictionary<string, string>) , ConsulRequest.Deserialize<TOut>(Stream) , ConsulRequest.Serialize(object) , object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()

Constructors

GetRequest(ConsulClient, string)

public GetRequest(ConsulClient client, string url)

Parameters

client ConsulClient

url string

GetRequest(ConsulClient, string, QueryOptions)

public GetRequest(ConsulClient client, string url, QueryOptions options)

Parameters

client ConsulClient

url string

options QueryOptions

GetRequest(ConsulClient, string, QueryOptions, IEncodable)

public GetRequest(ConsulClient client, string url, QueryOptions options, IEncodable filter)

Parameters

client ConsulClient

url string

options QueryOptions

filter IEncodable

Properties

Filter

public IEncodable Filter { get; }

Property Value

IEncodable

Options

public QueryOptions Options { get; set; }

Property Value

QueryOptions

Methods

ApplyHeaders(HttpRequestMessage, ConsulClientConfiguration)

protected override void ApplyHeaders(HttpRequestMessage message, ConsulClientConfiguration clientConfig)

Parameters

message HttpRequestMessage

clientConfig ConsulClientConfiguration

ApplyOptions(ConsulClientConfiguration)

protected override void ApplyOptions(ConsulClientConfiguration clientConfig)

Parameters

clientConfig ConsulClientConfiguration

Execute(CancellationToken)

Execute the GET request to the API

public Task<QueryResult<TOut>> Execute(CancellationToken ct)

Parameters

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns

Task <QueryResult <TOut>>

The result of the GET, including a deserialised generic type object

ExecuteStreaming(CancellationToken)

Execute the GET request to the API

public Task<QueryResult<Stream>> ExecuteStreaming(CancellationToken ct)

Parameters

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns

Task <QueryResult <Stream >>

The result of the GET, including a stream of data

ParseQueryHeaders(HttpResponseMessage, QueryResult<TOut>)

protected void ParseQueryHeaders(HttpResponseMessage res, QueryResult<TOut> meta)

Parameters

res HttpResponseMessage

meta QueryResult <TOut>

  • Constructors
    • GetRequest(ConsulClient, string)
    • GetRequest(ConsulClient, string, QueryOptions)
    • GetRequest(ConsulClient, string, QueryOptions, IEncodable)
  • Properties
    • Filter
    • Options
  • Methods
    • ApplyHeaders(HttpRequestMessage, ConsulClientConfiguration)
    • ApplyOptions(ConsulClientConfiguration)
    • Execute(CancellationToken)
    • ExecuteStreaming(CancellationToken)
    • ParseQueryHeaders(HttpResponseMessage, QueryResult<TOut>)