public class

HttpResponse

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

Class Overview

HTTP response holder.

Summary

Public Constructors
HttpResponse(byte[] bytes)

Constructor for HttpResponse.

Public Methods
Bitmap getBitmap()

Decodes and returns response as Bitmap.

byte[] getBytes()

Returns raw response as string.

JSONArray getJsonArray()

Decodes and returns response as JSONArray.

JSONObject getJsonObject()

Decodes and returns response as JSONObject.

String getString()

Decodes and returns response as string.

void setEncoding(String charsetName)

Sets encoding for this instance.

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

Public Constructors

public HttpResponse (byte[] bytes)

Constructor for HttpResponse.

Parameters
bytes byte: Byte array of data.

Public Methods

public Bitmap getBitmap ()

Decodes and returns response as Bitmap.

Returns
Bitmap Bitmap response or null if response is not bitmap.

public byte[] getBytes ()

Returns raw response as string.

Returns
byte[] Byte array response.

public JSONArray getJsonArray ()

Decodes and returns response as JSONArray.

Returns
JSONArray JSON array response or null if response is not JSON array.

public JSONObject getJsonObject ()

Decodes and returns response as JSONObject.

Returns
JSONObject JSON object response or null if response is not JSON object.

public String getString ()

Decodes and returns response as string.

Returns
String String response.

public void setEncoding (String charsetName)

Sets encoding for this instance. UTF-8 is used by default.

Parameters
charsetName String