类 HttpHeaderParser

java.lang.Object
com.android.volley.toolbox.HttpHeaderParser

public class HttpHeaderParser extends Object
Utility methods for parsing HTTP headers.
  • 构造器详细资料

    • HttpHeaderParser

      public HttpHeaderParser()
  • 方法详细资料

    • parseCacheHeaders

      public static Cache.Entry parseCacheHeaders(NetworkResponse response)
      Extracts a Cache.Entry from a NetworkResponse.
      参数:
      response - The network response to parse headers from
      返回:
      a cache entry for the given response, or null if the response is not cacheable.
    • parseDateAsEpoch

      public static long parseDateAsEpoch(String dateStr)
      Parse date in RFC1123 format, and return its value as epoch
    • parseCharset

      public static String parseCharset(Map<String,String> headers, String defaultCharset)
      Retrieve a charset from headers
      参数:
      headers - An Map of headers
      defaultCharset - Charset to return if none can be found
      返回:
      Returns the charset specified in the Content-Type of this header, or the defaultCharset if none can be found.
    • parseCharset

      public static String parseCharset(Map<String,String> headers)
      Returns the charset specified in the Content-Type of this header, or the HTTP default (ISO-8859-1) if none can be found.