Skip to content

Commit 52ba6dc

Browse files
committed
Correct headers for HTTP request
1 parent 7ea890f commit 52ba6dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

SlicingDice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ void SlicingDice::makeRequest(const char* query){
5757

5858
client.println("POST /v1/" + testEndPoint + "index HTTP/1.1");
5959
client.println(F("Content-Type: application/json"));
60+
String hostString = String(host);
61+
client.println("Host: " + hostString);
6062
client.println("Authorization: " + apiKey);
6163
client.println(F("Connection: close"));
6264

6365
String actualLength = String(strlen(query));
6466
client.println("Content-Length: " + actualLength);
65-
client.println();
67+
client.println();
6668
client.println(query);
6769
readResponse();
6870
client.stop();

0 commit comments

Comments
 (0)