Skip to main content
deleted 4 characters in body
Source Link
gre_gor
  • 1.7k
  • 4
  • 18
  • 30

HTTP GET request needs to end with an empty line and HTTP 1.1 requires a Host header.

Add an empty line and eiher change the HTTP version to 1.0

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.0");
client.println(); // empty line

or add the Host header

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.1\r\n"1");
client.print("Host:");
client.println(host);
client.println(); // empty line

HTTP GET request needs to end with an empty line and HTTP 1.1 requires a Host header.

Add an empty line and eiher change the HTTP version to 1.0

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.0");
client.println(); // empty line

or add the Host header

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.1\r\n");
client.print("Host:");
client.println(host);
client.println(); // empty line

HTTP GET request needs to end with an empty line and HTTP 1.1 requires a Host header.

Add an empty line and eiher change the HTTP version to 1.0

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.0");
client.println(); // empty line

or add the Host header

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.1");
client.print("Host:");
client.println(host);
client.println(); // empty line
Source Link
gre_gor
  • 1.7k
  • 4
  • 18
  • 30

HTTP GET request needs to end with an empty line and HTTP 1.1 requires a Host header.

Add an empty line and eiher change the HTTP version to 1.0

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.0");
client.println(); // empty line

or add the Host header

client.print("GET /channels/421932/feeds.json?api_key=");
client.print(apiKey);
client.println("&results=2 HTTP/1.1\r\n");
client.print("Host:");
client.println(host);
client.println(); // empty line