commonMain.com.apollographql.apollo3.network.http.HttpExecutionContext.kt Maven / Gradle / Ivy
package com.apollographql.apollo3.network.http
import com.apollographql.apollo3.api.ExecutionContext
import com.apollographql.apollo3.api.RequestContext
import com.apollographql.apollo3.api.ResponseContext
data class HttpRequestParameters(val headers: Map) : RequestContext(HttpRequestParameters) {
companion object Key : ExecutionContext.Key
}
fun HttpRequestParameters?.withHeader(name: String, value: String) = (this ?: HttpRequestParameters(emptyMap())).let {
it.copy(headers = it.headers + (name to value))
}
data class HttpResponseInfo(
val statusCode: Int,
val headers: Map
) : ResponseContext(HttpResponseInfo) {
companion object Key : ExecutionContext.Key
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy