0
J'ai essayé d'obtenir des informations météorologiques sur mon ESP8266 pour les afficher sur un écran OLED.ESP8266 Demande HTTP IDE JSON Arduino
if (!client.connect("api.apixu.com", 80)) {
Serial.println("connection failed");
return;}
client.print("GET " + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Content-Type: application/json\r\n" +
"Connection: close\r\n\r\n");
char c[1024];
// Read all the lines of the reply from server and print them to Serial
while(client.available()){
c[0] = client.read();Serial.print(c);}
C'est mon code pour demander et lire le contenu JSON. Mais quoi que j'essaie, le code n'entre pas dans la boucle while.
Quelqu'un peut-il repérer l'erreur?
Merci d'avance! : D