Table of Contents

Class RestClientOptions

Namespace
RestSharp
Assembly
RestSharp.dll
public class RestClientOptions
Inheritance
RestClientOptions
Inherited Members

Constructors

RestClientOptions()

public RestClientOptions()

RestClientOptions(string)

public RestClientOptions(string baseUrl)

Parameters

baseUrl string

RestClientOptions(Uri)

public RestClientOptions(Uri baseUrl)

Parameters

baseUrl Uri

Properties

AllowMultipleDefaultParametersWithSameName

By default, RestSharp doesn't allow multiple parameters to have the same name. This properly allows to override the default behavior.

public bool AllowMultipleDefaultParametersWithSameName { get; set; }

Property Value

bool

AutomaticDecompression

public DecompressionMethods AutomaticDecompression { get; set; }

Property Value

DecompressionMethods

BaseHost

public string? BaseHost { get; set; }

Property Value

string

BaseUrl

Explicit Host header value to use in requests independent from the request URI. If null, default host value extracted from URI is used.

public Uri? BaseUrl { get; set; }

Property Value

Uri

CachePolicy

public CacheControlHeaderValue? CachePolicy { get; set; }

Property Value

CacheControlHeaderValue

ClientCertificates

X509CertificateCollection to be sent with request

public X509CertificateCollection? ClientCertificates { get; set; }

Property Value

X509CertificateCollection

ConfigureMessageHandler

public Func<HttpMessageHandler, HttpMessageHandler>? ConfigureMessageHandler { get; set; }

Property Value

Func<HttpMessageHandler, HttpMessageHandler>

CookieContainer

public CookieContainer? CookieContainer { get; set; }

Property Value

CookieContainer

Credentials

In general you would not need to set this directly. Used by the NtlmAuthenticator.

public ICredentials? Credentials { get; set; }

Property Value

ICredentials

DisableCharset

Set to true if you need the Content-Type not to have the charset

public bool DisableCharset { get; set; }

Property Value

bool

Encoding

public Encoding Encoding { get; set; }

Property Value

Encoding

Expect100Continue

public bool? Expect100Continue { get; set; }

Property Value

bool?

FailOnDeserializationError

Modifies the default behavior of RestSharp to swallow exceptions. When set to

true
, RestSharp will consider the request as unsuccessful in case it fails to deserialize the response.
public bool FailOnDeserializationError { get; set; }

Property Value

bool

FollowRedirects

public bool FollowRedirects { get; set; }

Property Value

bool

MaxRedirects

public int? MaxRedirects { get; set; }

Property Value

int?

MaxTimeout

Maximum request duration in milliseconds. When the request timeout is specified using Timeout, the lowest value between the client timeout and request timeout will be used.

public int MaxTimeout { get; set; }

Property Value

int

PreAuthenticate

Flag to send authorisation header with the HttpWebRequest

public bool PreAuthenticate { get; set; }

Property Value

bool

Proxy

public IWebProxy? Proxy { get; set; }

Property Value

IWebProxy

RemoteCertificateValidationCallback

Callback function for handling the validation of remote certificates. Useful for certificate pinning and overriding certificate errors in the scope of a request.

public RemoteCertificateValidationCallback? RemoteCertificateValidationCallback { get; set; }

Property Value

RemoteCertificateValidationCallback

ThrowOnAnyError

Modifies the default behavior of RestSharp to swallow exceptions. When set to

true
, exceptions will be re-thrown.
public bool ThrowOnAnyError { get; set; }

Property Value

bool

ThrowOnDeserializationError

Modifies the default behavior of RestSharp to swallow exceptions. When set to

true
, a DeserializationException will be thrown in case RestSharp fails to deserialize the response.
public bool ThrowOnDeserializationError { get; set; }

Property Value

bool

Timeout

[Obsolete("Use MaxTimeout instead")]
public int Timeout { get; set; }

Property Value

int

UseDefaultCredentials

Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.

public bool UseDefaultCredentials { get; set; }

Property Value

bool

UserAgent

public string UserAgent { get; set; }

Property Value

string