HttpRequestResult

class HttpRequestResult(val url: String, val method: String, val statusCode: Int, val content: ByteArray, val headers: Map<String, List<String>>)

Stores result of a HttpRequest. A safer alternative to HttpResponse.

Parameters

url

URL of the queried resource.

method

HTTP method of the request.

statusCode

HTTP status code of the response. Might be set to -1 by internal libGDX implementation or if the status could not be determined.

content

response body stored as raw bytes.

headers

HTTP header values of the response. Might be empty.

Constructors

Link copied to clipboard
constructor(url: String, method: String, statusCode: Int, content: ByteArray, headers: Map<String, List<String>>)

Properties

Link copied to clipboard
Link copied to clipboard

Returns a new instance of ByteArrayInputStream with raw response bytes each time the getter is invoked.

Link copied to clipboard

Returns cached representation of the response stored as a string with default encoding.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val url: String

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun getContentAsString(charset: Charset = Charsets.UTF_8): String
Link copied to clipboard
fun getHeader(header: String): List<String>
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String