I want to send a PUT request to a rails server from Arduino.
this works in curl:
curl -X PUT -d "barrel[gallons]=99" 192.168.0.7:3000/barrels/1
The server gets the call and the gallons attribute is updated.
I don't know how to format this message in Arduino.
String request = "PUT /barrels/1.json?barrel[gallons]=99 HTTP/1.0";
send_request(request);
Adafruit_CC3000_Client client = cc3000.connectTCP(ip, port);
// Send request
if (client.connected()) {
client.println(request);
Serial.println("Connected & Data sent");
}
It does successfully connect to the client but the message has no effect. How should I format the request?