Class HttpHeadersUtils

java.lang.Object
com.google.api.gax.httpjson.HttpHeadersUtils

@NullMarked @InternalApi public class HttpHeadersUtils extends Object
This class is for internal use only and is public for technical reasons.
  • Constructor Details

    • HttpHeadersUtils

      public HttpHeadersUtils()
  • Method Details

    • getUserAgentValue

      public static @Nullable String getUserAgentValue(Map<String,String> headersMap)
    • getSingleHeader

      public static @Nullable String getSingleHeader(Map<String,Object> headers, String name)
      Retrieves the single string value of a header by case-insensitive name from a headers map.
      Parameters:
      headers - the map of header names to header values
      name - the case-insensitive header name to look up
      Returns:
      the single string value of the header, or null if not found
      Throws:
      IllegalArgumentException - if multiple values are present for the header
    • setHeaders

      public static com.google.api.client.http.HttpHeaders setHeaders(com.google.api.client.http.HttpHeaders headers, Map<String,String> headersMap)
    • setHeader

      public static com.google.api.client.http.HttpHeaders setHeader(com.google.api.client.http.HttpHeaders headers, String key, String value)