Skip to content
CShift0.45

HttpResponse

Struct · namespace System.Net · Since 0.42

struct HttpResponse

The answer of a server: its status, headers and body.

Name Description
Status The status code: 200 OK, 404 Not Found, …
RawHeaders The headers as the server sent them, one Name: value per line (\r\n); the status line comes first.
Body The body, as UTF-8 text.
int Status

The status code: 200 OK, 404 Not Found, …

string RawHeaders

The headers as the server sent them, one Name: value per line (\r\n); the status line comes first.

string Body

The body, as UTF-8 text.

Name Description
IsSuccess Whether the status is 2xx.
Header The value of the header name (the case of the name does not matter); the last one if the server sent it several times (after a redirect, the headers of every response are there).
bool IsSuccess()

Whether the status is 2xx.

Optional<string> Header(StringSlice name)

The value of the header name (the case of the name does not matter); the last one if the server sent it several times (after a redirect, the headers of every response are there).