Android HttpRequest class (version 2.1)

Version of of this class had some bugs so I corrected them and here is the latest version 🙂


You will also need the class below:

HTTP Request class for Android

Here is a class that can be used to make HTTP get and HTTP post requests. I haven’t commented everything but the usage should be pretty clear from the method signatures.

Note: This is for Android 1.5.

You will also need this class along with it.

  1. import java.util.Hashtable;
  3. public class HttpData {
  4.     public String content;
  5.     public Hashtable<String, String> cookies = new Hashtable<String, String>();
  6.     public Hashtable<String, String> headers = new Hashtable<String, String>();
  7. }