HttpResponse
Struct · namespace System.Net · Since 0.42
struct HttpResponseThe answer of a server: its status, headers and body.
Fields
Section titled “Fields”| 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. |
Status
Section titled “Status”int StatusThe status code: 200 OK, 404 Not Found, …
RawHeaders
Section titled “RawHeaders”string RawHeadersThe headers as the server sent them, one Name: value per line (\r\n); the status line comes first.
string BodyThe body, as UTF-8 text.
Methods
Section titled “Methods”| 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). |
IsSuccess
Section titled “IsSuccess”bool IsSuccess()Whether the status is 2xx.
Header
Section titled “Header”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).