Pages: [1]   Go Down
Author Topic: Help with ethernet client  (Read 538 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone,

I'm using an ehternet shield with an uno board to send some reports to a cloud application.
Here's a part of the code that i made in java to do that:

Code:
URLConnection cloudConnection = cloudServer.openConnection();
            cloudConnection.setDoOutput(true);
            cloudConnection.setRequestProperty("Content-Type",
                "multipart/form-data;boundary="+boundary);


I want to know how to do the setRequestProperty method on arduino c/c+ language. Any thoughts?

Best regards
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5981
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Generally, those are sent in the request header.

Code:
client.println("GET /mypage.html HTTP/1.1");
client.println("Host: www.mydomain.com");
client.println("Connection: close");
client.println("Any other header stuff you want to send");
// signal end of header with a blank line
client.println();
client.println("Any data you want to send");

...and the server returns stuff in it's header just about like that. The server header ends with a blank line also.
« Last Edit: February 10, 2012, 07:47:17 am by SurferTim » Logged

Pages: [1]   Go Up
Jump to: