Table of Contents

Class RestResponseBase

Namespace
RestSharp
Assembly
RestSharp.dll

Base class for common properties shared by RestResponse and RestResponse[[T]]

public abstract class RestResponseBase
Inheritance
RestResponseBase
Derived
Inherited Members

Constructors

RestResponseBase()

Default constructor

protected RestResponseBase()

Properties

Content

String representation of response content

public string? Content { get; set; }

Property Value

string

ContentEncoding

Encoding of the response content

public ICollection<string> ContentEncoding { get; set; }

Property Value

ICollection<string>

ContentHeaders

Content headers returned by server with the response

public IReadOnlyCollection<HeaderParameter>? ContentHeaders { get; set; }

Property Value

IReadOnlyCollection<HeaderParameter>

ContentLength

Length in bytes of the response content

public long? ContentLength { get; set; }

Property Value

long?

ContentType

MIME content type of response

public string? ContentType { get; set; }

Property Value

string

Cookies

Cookies returned by server with the response

public CookieCollection? Cookies { get; set; }

Property Value

CookieCollection

ErrorException

The exception thrown during the request, if any

public Exception? ErrorException { get; set; }

Property Value

Exception

ErrorMessage

Transport or other non-HTTP error generated while attempting request

public string? ErrorMessage { get; set; }

Property Value

string

Headers

Response headers returned by server with the response

public IReadOnlyCollection<HeaderParameter>? Headers { get; set; }

Property Value

IReadOnlyCollection<HeaderParameter>

IsSuccessStatusCode

Whether or not the HTTP response status code indicates success

public bool IsSuccessStatusCode { get; set; }

Property Value

bool

IsSuccessful

Whether or not the HTTP response status code indicates success and no other error occurred (deserialization, timeout, ...)

public bool IsSuccessful { get; }

Property Value

bool

RawBytes

Response content

public byte[]? RawBytes { get; set; }

Property Value

byte[]

Request

The RestRequest that was made to get this RestResponse

public RestRequest? Request { get; set; }

Property Value

RestRequest

Remarks

Mainly for debugging if ResponseStatus is not OK

ResponseStatus

Status of the request. Will return Error for transport errors. HTTP errors will still return ResponseStatus.Completed, check StatusCode instead

public ResponseStatus ResponseStatus { get; set; }

Property Value

ResponseStatus

ResponseUri

The URL that actually responded to the content (different from request if redirected)

public Uri? ResponseUri { get; set; }

Property Value

Uri

RootElement

Root element of the serialized response content, only works if deserializer supports it

public string? RootElement { get; set; }

Property Value

string

Server

HttpWebResponse.Server

public string? Server { get; set; }

Property Value

string

StatusCode

HTTP response status code

public HttpStatusCode StatusCode { get; set; }

Property Value

HttpStatusCode

StatusDescription

Description of HTTP status returned

public string? StatusDescription { get; set; }

Property Value

string

Version

HTTP protocol version of the request

public Version? Version { get; set; }

Property Value

Version

Methods

DebuggerDisplay()

Assists with debugging responses by displaying in the debugger output

protected string DebuggerDisplay()

Returns

string