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
AutomaticDecompression
public DecompressionMethods AutomaticDecompression { get; set; }
Property Value
BaseHost
public string? BaseHost { get; set; }
Property Value
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
ClientCertificates
X509CertificateCollection to be sent with request
public X509CertificateCollection? ClientCertificates { get; set; }
Property Value
ConfigureMessageHandler
public Func<HttpMessageHandler, HttpMessageHandler>? ConfigureMessageHandler { get; set; }
Property Value
CookieContainer
public CookieContainer? CookieContainer { get; set; }
Property Value
Credentials
In general you would not need to set this directly. Used by the NtlmAuthenticator.
public ICredentials? Credentials { get; set; }
Property Value
DisableCharset
Set to true if you need the Content-Type not to have the charset
public bool DisableCharset { get; set; }
Property Value
Encoding
public Encoding Encoding { get; set; }
Property Value
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
FollowRedirects
public bool FollowRedirects { get; set; }
Property Value
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
PreAuthenticate
Flag to send authorisation header with the HttpWebRequest
public bool PreAuthenticate { get; set; }
Property Value
Proxy
public IWebProxy? Proxy { get; set; }
Property Value
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
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
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
Timeout
[Obsolete("Use MaxTimeout instead")]
public int Timeout { get; set; }
Property Value
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
UserAgent
public string UserAgent { get; set; }