Home | Русский

How to Send an HTTP POST and GET Requests

As you might imagine, sending an HTTP POST request is a very similar process to sending a GET request.
See example.

public void httpRequest(){
Connect.getInstance().setParam(”all”, “getall”));
Connect.getInstance().setParam(”sessionid”, “64654sdf465sadf4″);
Connect.getInstance().doPost(”http://freesrc.com/”);
while (Connect.getInstance().isActive()) {
Thread.sleep(20);
}
[...]

Posted in: J2ME by admin No Comments , , ,

J2ME – Http Connection

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import java.io.*;

public class httpconnection extends MIDlet implements CommandListener {
private Command exit, start;
private Display display;
private Form form;
public httpconnection ()
{
display = Display.getDisplay(this);
exit = new Command(”Exit”, Command.EXIT, 1);
start = new Command(”Start”, Command.EXIT, 1);
[...]

Posted in: J2ME by admin No Comments , ,