From 55aae07d9c268ac7c6c2d4725b39653207373f62 Mon Sep 17 00:00:00 2001 From: Imre Horvath Date: Sun, 14 Aug 2022 10:05:11 +0200 Subject: [PATCH] Update README.md --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e8d328..15bcf4b 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,10 @@ void setup() { client.enableInsecure(); // Using HTTPS and peer cert. will not be able to auth. - client.postAsync("https://httpbin.org/post", "{\"key\":\"value\"}"); + String data = "{\"sensorData\":\""; + data += 123; + data += "\"}"; + client.postAsync("https://httpbin.org/post", data); SerialUSB.print("Sending request"); } @@ -172,7 +175,10 @@ __Synchronous requests__ client.get("https://httpbin.org/headers"); // HTTP POST a JSON payload, call won't return until finished -client.post("https://httpbin.org/post", "{\"key\":\"value\"}"); +String data = "{\"sensorData\":\""; +data += 123; +data += "\"}"; +client.post("https://httpbin.org/post", data); ``` __Asynchronous requests__