data class ResponseCode
This represents a CoAP response code (analogous to an HTTP response code (e.g. 201, 404, 500)
object Class |
ResponseCode(responseClass: Byte, detail: Byte)
This represents a CoAP response code (analogous to an HTTP response code (e.g. 201, 404, 500) |
val detail: Byte
is the class-specific detail code. (e.g. ResponseCode(2, 5) represents CONTENT and ResponseCode (4, 4) represents NOT_FOUND |
|
val responseClass: Byte
Response Class is the major class of the code. 2 = Success, 3 = Redirection, 4 = Client Error, 5 = Server Error |
val badGateway: ResponseCode
CoAP Response Code 502 |
|
val badOption: ResponseCode
CoAP Response Code 402 |
|
val badRequest: ResponseCode
CoAP Response Code 400 |
|
val changed: ResponseCode
CoAP Response Code 204 |
|
val content: ResponseCode
CoAP Response Code 205 |
|
val continue: ResponseCode
CoAP Response Code 231 |
|
val created: ResponseCode
CoAP Response Code 201 |
|
val deleted: ResponseCode
CoAP Response Code 202 |
|
val forbidden: ResponseCode
CoAP Response Code 403 |
|
val gatewayTimeout: ResponseCode
CoAP Response Code 504 |
|
val internalServerError: ResponseCode
CoAP Response Code 500 |
|
val methodNotAllowed: ResponseCode
CoAP Response Code 405 |
|
val notAcceptable: ResponseCode
CoAP Response Code 406 |
|
val notFound: ResponseCode
CoAP Response Code 404 |
|
val notImplemented: ResponseCode
CoAP Response Code 501 |
|
val preconditionFailed: ResponseCode
CoAP Response Code 412 |
|
val proxyingNotSupported: ResponseCode
CoAP Response Code 505 |
|
val requestEntityIncomplete: ResponseCode
CoAP Response Code 408 |
|
val requestEntityTooLarge: ResponseCode
CoAP Response Code 413 |
|
val serviceUnavailable: ResponseCode
CoAP Response Code 503 |
|
val unauthorized: ResponseCode
CoAP Response Code 401 |
|
val unsupportedContentFormat: ResponseCode
CoAP Response Code 415 |
|
val valid: ResponseCode
CoAP Response Code 203 |
fun ResponseCode.clientError(): Boolean
Extension function that return true if response is client error, false otherwise |
|
fun ResponseCode.error(): Boolean
Extension function that return true if response is client or server error, false otherwise |
|
fun ResponseCode.ok(): Boolean
Extension function that return true if response is ok, false otherwise |
|
fun ResponseCode.serverError(): Boolean
Extension function that return true if response is server error, false otherwise |