Skip to content

Most visited

Recently visited

navigation

DefaultHttpResponseFactory | Android Developers

to top
Android APIs
public class

DefaultHttpResponseFactory

extends Object
implements HttpResponseFactory
java.lang.Object
   ↳ org.apache.http.impl.DefaultHttpResponseFactory

Class Overview

Default implementation of a factory for creating response objects.

Summary

Fields
protected final ReasonPhraseCatalog reasonCatalog The catalog for looking up reason phrases.
Public Constructors
DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
Creates a new response factory with the given catalog.
DefaultHttpResponseFactory()
Creates a new response factory with the default catalog.
Public Methods
HttpResponse newHttpResponse(ProtocolVersion ver, int status, HttpContext context)
Creates a new response from status line elements.
HttpResponse newHttpResponse(StatusLine statusline, HttpContext context)
Creates a new response from a status line.
Protected Methods
Locale determineLocale(HttpContext context)
Determines the locale of the response.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.HttpResponseFactory

Fields

protected final ReasonPhraseCatalog reasonCatalog

Added in API level 1

The catalog for looking up reason phrases.

Public Constructors

public DefaultHttpResponseFactory (ReasonPhraseCatalog catalog)

Added in API level 1

Creates a new response factory with the given catalog.

Parameters
catalog the catalog of reason phrases

public DefaultHttpResponseFactory ()

Added in API level 1

Creates a new response factory with the default catalog. The default catalog is EnglishReasonPhraseCatalog.

Public Methods

public HttpResponse newHttpResponse (ProtocolVersion ver, int status, HttpContext context)

Added in API level 1

Creates a new response from status line elements.

Parameters
ver the protocol version
status the status code
context the context from which to determine the locale for looking up a reason phrase to the status code, or null to use the default locale
Returns
  • the new response with an initialized status line

public HttpResponse newHttpResponse (StatusLine statusline, HttpContext context)

Added in API level 1

Creates a new response from a status line.

Parameters
statusline the status line
context the context from which to determine the locale for looking up a reason phrase if the status code is updated, or null to use the default locale
Returns
  • the new response with the argument status line

Protected Methods

protected Locale determineLocale (HttpContext context)

Added in API level 1

Determines the locale of the response. The implementation in this class always returns the default locale.

Parameters
context the context from which to determine the locale, or null to use the default locale
Returns
  • the locale for the response, never null
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.