2

I'm using Arduino UNO WIFI shield, and I have read your library Ciao (https://github.com/arduino-org/Ciao) and it's excellent, so I'm working for send datas with method post request, but I could not send my datas. this is my code:

char * method = "POST";
char * CONNECTOR   = "rest"; 
char * SERVER_ADDR   = "myserver.com"; 

String uri = "/public/auth_login";
String post_data = "name=Alice&age=12";
CiaoData data = Ciao.write(CONNECTOR,SERVER_ADDR, uri, method);

I know that Ciao.write receives four values, so, where I can put my post datas?

oh! please, can you help me?

Thanks, so much!

andreszam24
  • 351
  • 2
  • 3
  • 12

1 Answers1

0
char * CONNECTOR   = "rest"; 
char * SERVER_ADDR   = "myserver.com"; 

String uri = "/public/auth_login?name=Alice&age=12";

CiaoData data = Ciao.write(CONNECTOR,SERVER_ADDR, uri);

I have used the Ciao library like this to send data and this seems to work.

Wombat
  • 172
  • 3
  • 10
  • Hey my friend, the problem with your code is that the http method petition is GET, so I can't send a varible like ?name=Alice#Thompson or any special character that you may need. In my case I had to change the shield and use Ethernet to sen POST petition. – andreszam24 Nov 10 '16 at 05:57