feat: send value in https with auth user
This commit is contained in:
parent
be7a2829f6
commit
212f662882
@ -16,12 +16,15 @@ SoftwareSerial Serial1(6, 7); // RX, TX
|
||||
#endif
|
||||
|
||||
char ssid[] = "Clement4G"; // TODO: mettre id wifi dans config.ini
|
||||
char pass[] = "***"; // TODO: mettre pass wifi dans config.ini
|
||||
char pass[] = "Clement123"; // TODO: mettre pass wifi dans config.ini
|
||||
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
||||
|
||||
//char server[] = "arduino.tips";
|
||||
|
||||
char server[] = "iot2.epi.cb85.software";
|
||||
char server[] = "iot.epi.cb85.software";
|
||||
|
||||
|
||||
String tocken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE2ODExMzM4NDMsImlkIjoiZnNlNm9uZ3AxNHN5bHVvIiwidHlwZSI6ImF1dGhSZWNvcmQifQ.QKvfyAQ-lxLHTLyZIQ0FrMYFn5XPTujY_N1Oz6BRHn4";
|
||||
|
||||
void printWifiStatus();
|
||||
|
||||
@ -63,14 +66,16 @@ void setup() {
|
||||
Serial.println("Connected to server");
|
||||
// Make a HTTP request
|
||||
// client.println("GET /api/collections/poubelle_status/records HTTP/1.1");
|
||||
// client.println("Host: iot2.epi.cb85.software");
|
||||
// client.println("Host: iot.epi.cb85.software");
|
||||
// client.println("Connection: close");
|
||||
// client.println();
|
||||
String data = "{\"value\": \"test123\"}";
|
||||
client.println("POST /api/collections/poubelle_status/records HTTP/1.1");
|
||||
client.println("Host: iot2.epi.cb85.software");
|
||||
String data = "{\"value\": \"123\",\"trash_id\": \"gdnuxl0wlgurtj3\",\"unit\": \"test\",\"status\": true}";
|
||||
|
||||
client.println("POST /api/collections/data/records HTTP/1.1");
|
||||
client.println("Host: iot.epi.cb85.software");
|
||||
client.println("Content-Type: application/json");
|
||||
client.println("Content-Length: " + String(data.length()));
|
||||
client.println("Authorization: Bearer "+tocken);
|
||||
client.println();
|
||||
client.println(data);
|
||||
client.println("Connection: close");
|
||||
|
Loading…
x
Reference in New Issue
Block a user