RestSharp · Schema

RestClientOptions

Configuration options for the RestSharp RestClient. Passed to the RestClient constructor to configure base URL, authentication, timeouts, redirects, and HTTP client behavior.

.NETApache LicenseC#HTTP ClientNuGetOpen SourceSDKs

Properties

Name Type Description
baseUrl string Base URL for all requests made by this client
authenticator object IAuthenticator implementation for request authentication (OAuth1, OAuth2, HTTP Basic, JWT Bearer)
timeout integer Request timeout in milliseconds. 0 = no timeout (use with caution)
maxTimeout integer Maximum request timeout in milliseconds
followRedirects boolean Whether to automatically follow HTTP redirects. Default: true
maxRedirects integer Maximum number of redirects to follow
userAgent string User-Agent header value. Default: RestSharp/{version}
encoding string Default encoding for request and response content
preAuthenticate boolean Whether to send credentials with the first request. Default: false
useDefaultCredentials boolean Whether to use default system credentials. Default: false
disableCharset boolean Whether to omit charset from Content-Type header. Default: false
allowMultipleDefaultParametersWithSameName boolean Whether to allow multiple default parameters with the same name. Default: false
View JSON Schema on GitHub

JSON Schema

restsharp-rest-client-options-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://restsharp.dev/schemas/rest-client-options",
  "title": "RestClientOptions",
  "description": "Configuration options for the RestSharp RestClient. Passed to the RestClient constructor to configure base URL, authentication, timeouts, redirects, and HTTP client behavior.",
  "type": "object",
  "properties": {
    "baseUrl": {
      "type": "string",
      "format": "uri",
      "description": "Base URL for all requests made by this client"
    },
    "authenticator": {
      "type": "object",
      "description": "IAuthenticator implementation for request authentication (OAuth1, OAuth2, HTTP Basic, JWT Bearer)"
    },
    "timeout": {
      "type": "integer",
      "description": "Request timeout in milliseconds. 0 = no timeout (use with caution)"
    },
    "maxTimeout": {
      "type": "integer",
      "description": "Maximum request timeout in milliseconds"
    },
    "followRedirects": {
      "type": "boolean",
      "description": "Whether to automatically follow HTTP redirects. Default: true",
      "default": true
    },
    "maxRedirects": {
      "type": "integer",
      "description": "Maximum number of redirects to follow"
    },
    "userAgent": {
      "type": "string",
      "description": "User-Agent header value. Default: RestSharp/{version}"
    },
    "encoding": {
      "type": "string",
      "description": "Default encoding for request and response content"
    },
    "preAuthenticate": {
      "type": "boolean",
      "description": "Whether to send credentials with the first request. Default: false",
      "default": false
    },
    "useDefaultCredentials": {
      "type": "boolean",
      "description": "Whether to use default system credentials. Default: false",
      "default": false
    },
    "disableCharset": {
      "type": "boolean",
      "description": "Whether to omit charset from Content-Type header. Default: false",
      "default": false
    },
    "allowMultipleDefaultParametersWithSameName": {
      "type": "boolean",
      "description": "Whether to allow multiple default parameters with the same name. Default: false",
      "default": false
    }
  }
}