SimpleHttpResult

Description

struct Tinman.Core.IO.SimpleHttpResult

Represents the result of a HTTP/HTTPS request.

See also

ISimpleHttp

Public / Methods

Compute​Hash


[Pure]
public static method ComputeHash → (2)

etag in : string

The ETag response header field or null if not present.

lastModified in : string

The Last-Modified response header field or null if not present.

returns → GUID

The value for Hash.

Computes the value for Hash, based on the given HTTP response header values.

Throw​If​Failure


[Pure]
public method ThrowIfFailure → (1)

source in : string

The error source tag.

Throws an IOException if this result represents a failure.

IOException

If IsSuccess returns false.

To​String


public override method ToString → ()

returns → string

The string representation.

Returns the string representation of this value.

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 Error.

Public / Attributes

Content​Type


public readonly attribute ContentType → (string)

Value of the Content-Type HTTP response header field.

Error


public readonly attribute Error → (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?

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 is present (it may be omitted in some cases, for example when using HTTP Chunked Transfer Coding).

Status​Code


public readonly attribute StatusCode → (int32)

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

Status​Text


public readonly attribute StatusText → (string)

The HTTP status text.

Time


public readonly attribute Time → (int32)

The total time of the request, in milliseconds.