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
ContentEncoding
Encoding of the response content
public ICollection<string> ContentEncoding { get; set; }
Property Value
ContentHeaders
Content headers returned by server with the response
public IReadOnlyCollection<HeaderParameter>? ContentHeaders { get; set; }
Property Value
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
Cookies
Cookies returned by server with the response
public CookieCollection? Cookies { get; set; }
Property Value
ErrorException
The exception thrown during the request, if any
public Exception? ErrorException { get; set; }
Property Value
ErrorMessage
Transport or other non-HTTP error generated while attempting request
public string? ErrorMessage { get; set; }
Property Value
Headers
Response headers returned by server with the response
public IReadOnlyCollection<HeaderParameter>? Headers { get; set; }
Property Value
IsSuccessStatusCode
Whether or not the HTTP response status code indicates success
public bool IsSuccessStatusCode { get; set; }
Property Value
IsSuccessful
Whether or not the HTTP response status code indicates success and no other error occurred (deserialization, timeout, ...)
public bool IsSuccessful { get; }
Property Value
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
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
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
Server
HttpWebResponse.Server
public string? Server { get; set; }
Property Value
StatusCode
HTTP response status code
public HttpStatusCode StatusCode { get; set; }
Property Value
StatusDescription
Description of HTTP status returned
public string? StatusDescription { get; set; }
Property Value
Version
HTTP protocol version of the request
public Version? Version { get; set; }
Property Value
Methods
DebuggerDisplay()
Assists with debugging responses by displaying in the debugger output
protected string DebuggerDisplay()