public final class

HttpHolder

extends Object
java.lang.Object
   ↳ chan.http.HttpHolder

Class Overview

HTTP connection holder.

Summary

Public Constructors
HttpHolder()
Public Methods
void checkResponseCode()

This method will throw HttpException if response code is not success (2xx) or redirect (301, 302, 303 or 307).

void disconnect()

Disconnect from server.

String getCookieValue(String name)

Decodes and returns cookie by given name.

Map<String, List<String>> getHeaderFields()

Returns map of all HTTP header fields.

Uri getRedirectedUri()

Returns redirected URI from Location header.

int getResponseCode()

Returns response code from last connection.

String getResponseMessage()

Returns response message from last connection.

HttpValidator getValidator()

Returns HttpValidator instance, decoded from header.

HttpResponse read()

Reads HttpResponse from server.

[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public HttpHolder ()

Public Methods

public void checkResponseCode ()

This method will throw HttpException if response code is not success (2xx) or redirect (301, 302, 303 or 307).

Throws
HttpException

public void disconnect ()

Disconnect from server.

public String getCookieValue (String name)

Decodes and returns cookie by given name.

Parameters
name String: Name of cookie.
Returns
String Value of cookie or null if given cookie doesn't exist.

public Map<String, List<String>> getHeaderFields ()

Returns map of all HTTP header fields.

Returns
Map<String, List<String>> HTTP header fields.

public Uri getRedirectedUri ()

Returns redirected URI from Location header.

Returns
Uri Redirected URI.

public int getResponseCode ()

Returns response code from last connection.

Returns
int Response code.

public String getResponseMessage ()

Returns response message from last connection.

Returns
String Response message.

public HttpValidator getValidator ()

Returns HttpValidator instance, decoded from header.

Returns
HttpValidator HttpValidator instance.

See also:

public HttpResponse read ()

Reads HttpResponse from server.

Returns
HttpResponse
Throws
HttpException