Package com.apollographql.apollo3.api.http

Types

Link copied to clipboard
class ByteStringHttpBody(val contentType: String, byteString: ByteString) : HttpBody
Link copied to clipboard
class DefaultHttpRequestComposer(serverUrl: String) : HttpRequestComposer

An HttpRequestComposer that handles:

Link copied to clipboard
Link copied to clipboard
interface HttpBody
Link copied to clipboard
data class HttpHeader(val name: String, val value: String)

a HTTP header

Link copied to clipboard
enum HttpMethod : Enum<HttpMethod>
Link copied to clipboard
class HttpRequest

a HTTP request to be sent

Link copied to clipboard
interface HttpRequestComposer

HttpRequestComposer transforms a GraphQL request in a HttpRequest. Typically, this involves building a Json with "query" and "variables" fields but implementations can decide to customize this behaviour. For an example:

Link copied to clipboard
class HttpResponse

an HTTP Response.

Link copied to clipboard
class UploadsHttpBody(uploads: Map<String, Upload>, operationByteString: ByteString) : HttpBody
Link copied to clipboard
interface WebSocketPayloadComposer

WebSocketPayloadComposer transforms a GraphQL request in a payload to be sent in a WebSocket message

Functions

Link copied to clipboard
fun List<HttpHeader>.get(name: String): String?

Get the value for header name or null if this header doesn't exist or is defined multiple times

Link copied to clipboard
fun List<HttpHeader>.valueOf(name: String): String?

Get the value of the "name" header. HTTP header names are case insensitive, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2