public class

HttpUtils

extends Object
java.lang.Object
   ↳ com.android.mms.transaction.HttpUtils

Summary

Constants
int HTTP_GET_METHOD
int HTTP_POST_METHOD
Protected Methods
static byte[] httpConnection(Context context, long token, String url, byte[] pdu, int method, boolean isProxySet, String proxyHost, int proxyPort)
A helper method to send or retrieve data through HTTP protocol.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int HTTP_GET_METHOD

Constant Value: 2 (0x00000002)

public static final int HTTP_POST_METHOD

Constant Value: 1 (0x00000001)

Protected Methods

protected static byte[] httpConnection (Context context, long token, String url, byte[] pdu, int method, boolean isProxySet, String proxyHost, int proxyPort)

A helper method to send or retrieve data through HTTP protocol.

Parameters
token The token to identify the sending progress.
url The URL used in a GET request. Null when the method is HTTP_POST_METHOD.
pdu The data to be POST. Null when the method is HTTP_GET_METHOD.
method HTTP_POST_METHOD or HTTP_GET_METHOD.
Returns
  • A byte array which contains the response data. If an HTTP error code is returned, an IOException will be thrown.
Throws
IOException if any error occurred on network interface or an HTTP error code(>=400) returned from the server.