Skip to main content
1 of 5

Arduino ESP8266 HTTPS Request returning empty response

I want to get some JSON data from a HTTPS secured Webserver using a ESP8266. For some reason I'm getting an empty response, I believe there's an error parsing the GET request. In Chrome I get the JSON response without problems.

GET Request:

httpsClient.print(String("GET ") + path + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +               
               "Connection: close\r\n\r\n");

Host and Path:

const char *host = "www.adler-mannheim.de";
const char *path = "/jsonapi/game/current";

UPDATE:

I tried fetching some JSON from another Server and it worked finde, so i can rule out my code. Fiddling around with the host and path I observe this:

  • Hostname without "www" results in a 301
  • Hostname with "https://www" results in no HTTPS connection at all

So it seems that a "www" is required although it unfortunately leads into a empty response.

How can I fix that?