Creating a web client to submit data to SQL

I’ve been looking for quite a long time for how to create a « http client » that could pass data as with the POST method from a Tini. That way, I’ll be able to send data to be logged to the linux webserver and then, with a PHP page, I’ll send data to the SQL database.

Here’s an example I found on Dallas Semiconductor Forums. By the way, be sure to register and spend a lot of time reading over there. There’s a lot of information.

I have an example of my own… see if this one helps
in my case I’m sure there’s no data above the 300 bytes- you might need to make a loop in your case to keep reading until no data is left – or a timeout.

private boolean HTTPData() {

try {
URL url = new URL("http", Config.ServerIP(), 80, "/engine.asp");
Connection http = new Connection(url);

byte[] datain = new byte[300];
int data_count;


System.out.print("Connect ");

OutputStream outs = http.getOutputStream();

InputStream ins = http.getInputStream();
System.out.print("Response ");
data_count =;

System.out.print("Disconnect ");

return true;


} catch (MalformedURLException e) {
System.out.println("URL " + e.toString());
} catch (IOException e) {
System.out.println("IO " + e.toString());

return false;

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *