HttpError

HTTP status codes recognised by libtorrent, ported from errors::http_errors (include/libtorrent/error_code.hpp) and the http_error_category message formatter in src/error_code.cpp.

In libtorrent these live in a separate http_category() whose message(ev) renders the numeric status followed by a space and the reason phrase, e.g. "404 Not Found". Unlike LibtorrentError, the code values here are sparse (real HTTP status codes), so this is not an index-addressable table; use fromCodeOrNull for lookup.

Entries

Link copied to clipboard

100 Continue

Link copied to clipboard

200 OK

Link copied to clipboard

201 Created

Link copied to clipboard

202 Accepted

Link copied to clipboard

204 No Content

Link copied to clipboard

300 Multiple Choices

Link copied to clipboard

301 Moved Permanently

Link copied to clipboard

302 Moved Temporarily (Found)

Link copied to clipboard

304 Not Modified

Link copied to clipboard

400 Bad Request

Link copied to clipboard

401 Unauthorized

Link copied to clipboard

403 Forbidden

Link copied to clipboard

404 Not Found

Link copied to clipboard

500 Internal Server Error

Link copied to clipboard

501 Not Implemented

Link copied to clipboard

502 Bad Gateway

Link copied to clipboard

503 Service Unavailable

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val code: Int

the HTTP status code.

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard

The full category message libtorrent's http_category().message() would produce: the status number, a space, then the reason phrase. e.g. HttpError.NOT_FOUND.message == "404 Not Found".

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int
Link copied to clipboard

the reason phrase libtorrent appends after the status number.

Functions

Link copied to clipboard
fun valueOf(value: String): HttpError

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.