SimpleHttpResult

Description

struct Tinman.Core.IO.SimpleHttpResult

Represents the result of a HTTP/HTTPS request.

The string representation is '(CODE) TEXT', where CODE is the value of StatusCode and TEXT is the value of StatusText. If StatusCode is 0, then CODE will be set to -N-1, where N is the ordinal value of ErrorCode.

See also

ISimpleHttp

Public / Constructors

Bad​Url


public static method BadUrl → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because the given URL is invalid.

See also

IOError.BadPath

Cancel


public static method Cancel → ()

returns → SimpleHttpResult

The result value.

The HTTP request has failed because it has been cancelled.

Content​Incomplete


public static method ContentIncomplete → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because the received content is incomplete.

See also

IOError.Corrupt

Content​Not​Supported


public static method ContentNotSupported → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because the content type is not supported.

Content​Overflow


public static method ContentOverflow → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because the content size is too big.

See also

IOError.Corrupt

Failure


public static method Failure → (2)

message in : string

The error message.

errorCode in : IOError

The error code.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because of a non-protocol error.

Not​Found


public static method NotFound → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because the target resource cannot be found.

See also

IOError.NotFound

Timeout


public static method Timeout → (1)

url in : string

The request URL.

returns → SimpleHttpResult

The result value.

The HTTP request has failed because it has timed out.

See also

IOError.TimeOut

Public / Methods

Throw


public method Throw → ()

returns → IOException

The ready-to-throw exception.

Returns an exception for this request result.

Public / Attributes

Content​Type


public readonly attribute ContentType → (string)

Value of the Content-Type HTTP response header field.

Error​Code


public readonly attribute ErrorCode → (IOError)

The non-protocol error that has occurred.

If StatusCode is equal to 0, this value describes the non-protocol error that has occurred. Otherwise, this value has no meaning and will be set to IOError.Other.

Hash


public readonly attribute Hash → (GUID)

A digest of the ETag and the Last-Modified HTTP response header field.

Is​Success


public attribute IsSuccess → (get)

value : bool

true if the HTTP request was successful, false if it has failed.

Does this SimpleHttpResult value represent a successful HTTP request?

A successful HTTP request in this context means that the requested information has been received from the server (i.e. HEAD metadata or GET content).

Length


public readonly attribute Length → (int64)

Length of the content, in bytes.

This is the number of received content bytes. Will be equal to the value of the Content-Length HTTP response header field (if it was present) successful requests and 0 for non-successful requests.

Should​Try​Again


public attribute ShouldTryAgain → (get)

value : bool

true if trying again might solve the problem,
false if this is a permanent failure.

Does this SimpleHttpResult represent a temporary failure that might be resolved by trying again?

Status​Code


public readonly attribute StatusCode → (int32)

The HTTP status code or 0 for non-protocol errors (see ErrorCode).

Status​Text


public readonly attribute StatusText → (string)

The HTTP status text.