NUKnightLab / SensorGrid

10 stars 2 forks source link

HTTP POST Error #37

Closed vcabales closed 6 years ago

vcabales commented 7 years ago

Invalid Request Line'Invalid HTTP request line: 'HTTP/1.1 /data''

Confusion about how the HTTP POST request should be formatted. Using ArduinoJson to send the request.

void writeResponse(EthernetClient& client, JsonObject& json) {
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: application/json");
  client.println("Connection: close");
  client.println();

  json.prettyPrintTo(client);
}