Top |
Functions
#define | SOUP_STATUS_IS_TRANSPORT_ERROR() |
#define | SOUP_STATUS_IS_INFORMATIONAL() |
#define | SOUP_STATUS_IS_SUCCESSFUL() |
#define | SOUP_STATUS_IS_REDIRECTION() |
#define | SOUP_STATUS_IS_CLIENT_ERROR() |
#define | SOUP_STATUS_IS_SERVER_ERROR() |
const char * | soup_status_get_phrase () |
guint | soup_status_proxify () |
Functions
SOUP_STATUS_IS_TRANSPORT_ERROR()
#define SOUP_STATUS_IS_TRANSPORT_ERROR(status) ((status) > 0 && (status) < 100)
Tests if status
is a libsoup transport error.
SOUP_STATUS_IS_INFORMATIONAL()
#define SOUP_STATUS_IS_INFORMATIONAL(status) ((status) >= 100 && (status) < 200)
Tests if status
is an Informational (1xx) response.
SOUP_STATUS_IS_SUCCESSFUL()
#define SOUP_STATUS_IS_SUCCESSFUL(status) ((status) >= 200 && (status) < 300)
Tests if status
is a Successful (2xx) response.
SOUP_STATUS_IS_REDIRECTION()
#define SOUP_STATUS_IS_REDIRECTION(status) ((status) >= 300 && (status) < 400)
Tests if status
is a Redirection (3xx) response.
SOUP_STATUS_IS_CLIENT_ERROR()
#define SOUP_STATUS_IS_CLIENT_ERROR(status) ((status) >= 400 && (status) < 500)
Tests if status
is a Client Error (4xx) response.
SOUP_STATUS_IS_SERVER_ERROR()
#define SOUP_STATUS_IS_SERVER_ERROR(status) ((status) >= 500 && (status) < 600)
Tests if status
is a Server Error (5xx) response.
soup_status_get_phrase ()
const char *
soup_status_get_phrase (guint status_code
);
Looks up the stock HTTP description of status_code
. This is used
by soup_message_set_status()
to get the correct text to go with a
given status code.
There is no reason for you to ever use this function. If you wanted the textual description for the “status_code” of a given SoupMessage, you should just look at the message's “reason_phrase”. However, you should only do that for use in debugging messages; HTTP reason phrases are not localized, and are not generally very descriptive anyway, and so they should never be presented to the user directly. Instead, you should create you own error messages based on the status code, and on what you were trying to do.
soup_status_proxify ()
guint
soup_status_proxify (guint status_code
);
Turns SOUP_STATUS_CANT_RESOLVE
into
SOUP_STATUS_CANT_RESOLVE_PROXY
and SOUP_STATUS_CANT_CONNECT
into
SOUP_STATUS_CANT_CONNECT_PROXY
. Other status codes are passed
through unchanged.
Since 2.26
Types and Values
enum SoupStatus
These represent the known HTTP status code values, plus various network and internal errors.
Note that no libsoup functions take or return this type directly; any function that works with status codes will accept unrecognized status codes as well.
Prior to 2.44 this type was called
SoupKnownStatusCode
, but the individual values
have always had the names they have now.
Members
No status available. (Eg, the message has not been sent yet) |
||
Message was cancelled locally |
||
Unable to resolve destination host name |
||
Unable to resolve proxy host name |
||
Unable to connect to remote host |
||
Unable to connect to proxy |
||
SSL/TLS negotiation failed |
||
A network error occurred, or the other end closed the connection unexpectedly |
||
Malformed data (usually a programmer error) |
||
Used internally |
||
There were too many redirections |
||
Used internally |
||
100 Continue (HTTP) |
||
101 Switching Protocols (HTTP) |
||
102 Processing (WebDAV) |
||
200 Success (HTTP). Also used by many lower-level soup routines to indicate success. |
||
201 Created (HTTP) |
||
202 Accepted (HTTP) |
||
203 Non-Authoritative Information (HTTP) |
||
204 No Content (HTTP) |
||
205 Reset Content (HTTP) |
||
206 Partial Content (HTTP) |
||
207 Multi-Status (WebDAV) |
||
300 Multiple Choices (HTTP) |
||
301 Moved Permanently (HTTP) |
||
302 Found (HTTP) |
||
302 Moved Temporarily (old name, RFC 2068) |
||
303 See Other (HTTP) |
||
304 Not Modified (HTTP) |
||
305 Use Proxy (HTTP) |
||
306 [Unused] (HTTP) |
||
307 Temporary Redirect (HTTP) |
||
400 Bad Request (HTTP) |
||
401 Unauthorized (HTTP) |
||
402 Payment Required (HTTP) |
||
403 Forbidden (HTTP) |
||
404 Not Found (HTTP) |
||
405 Method Not Allowed (HTTP) |
||
406 Not Acceptable (HTTP) |
||
407 Proxy Authentication Required (HTTP) |
||
shorter alias for
|
||
408 Request Timeout (HTTP) |
||
409 Conflict (HTTP) |
||
410 Gone (HTTP) |
||
411 Length Required (HTTP) |
||
412 Precondition Failed (HTTP) |
||
413 Request Entity Too Large (HTTP) |
||
414 Request-URI Too Long (HTTP) |
||
415 Unsupported Media Type (HTTP) |
||
416 Requested Range Not Satisfiable (HTTP) |
||
shorter alias for
|
||
417 Expectation Failed (HTTP) |
||
422 Unprocessable Entity (WebDAV) |
||
423 Locked (WebDAV) |
||
424 Failed Dependency (WebDAV) |
||
500 Internal Server Error (HTTP) |
||
501 Not Implemented (HTTP) |
||
502 Bad Gateway (HTTP) |
||
503 Service Unavailable (HTTP) |
||
504 Gateway Timeout (HTTP) |
||
505 HTTP Version Not Supported (HTTP) |
||
507 Insufficient Storage (WebDAV) |
||
510 Not Extended (RFC 2774) |
SOUP_HTTP_ERROR
#define SOUP_HTTP_ERROR soup_http_error_quark()
A GError domain representing an HTTP status. Use a SoupStatus for
the code
value.