public class

HttpHeaderParser

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

Class Overview

Utility methods for parsing HTTP headers.

Summary

Public Constructors
HttpHeaderParser()
Public Methods
static Cache.Entry parseCacheHeaders(NetworkResponse response)
Extracts a Cache.Entry from a NetworkResponse.
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.
static String parseCharset(Map<String, String> headers, String defaultCharset)
Retrieve a charset from headers
static long parseDateAsEpoch(String dateStr)
Parse date in RFC1123 format, and return its value as epoch
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public HttpHeaderParser ()

Public Methods

public static Cache.Entry parseCacheHeaders (NetworkResponse response)

Extracts a Cache.Entry from a NetworkResponse.

Parameters
response The network response to parse headers from
Returns
  • a cache entry for the given response, or null if the response is not cacheable.

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.

public static String parseCharset (Map<String, String> headers, String defaultCharset)

Retrieve a charset from headers

Parameters
headers An java.util.Map of headers
defaultCharset Charset to return if none can be found
Returns
  • Returns the charset specified in the Content-Type of this header, or the defaultCharset if none can be found.

public static long parseDateAsEpoch (String dateStr)

Parse date in RFC1123 format, and return its value as epoch