Skip to content

Commit

Permalink
Deprecate HttpNetworkTransport.httpHeaders() (#6074)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Jul 24, 2024
1 parent ba2aaf1 commit 6b16509
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.apollographql.apollo.network.http

import com.apollographql.apollo.annotations.ApolloDeprecatedSince
import com.apollographql.apollo.api.ApolloRequest
import com.apollographql.apollo.api.ApolloResponse
import com.apollographql.apollo.api.CustomScalarAdapters
Expand Down Expand Up @@ -303,10 +304,14 @@ private constructor(
this.exposeErrorBody = exposeErrorBody
}

@Deprecated("Use ApolloClient.Builder.addHttpHeader() instead")
@ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v4_0_0)
fun addHttpHeader(name: String, value: String) = apply {
headers.add(HttpHeader(name, value))
}

@Deprecated("Use ApolloClient.Builder.httpHeader() instead")
@ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v4_0_0)
fun httpHeaders(headers: List<HttpHeader>) = apply {
// In case this builder comes from newBuilder(), remove any existing interceptor
interceptors.removeAll {
Expand Down

0 comments on commit 6b16509

Please sign in to comment.