title: How to add Headers to http request in Arduino IDE
body: <p>This is the code in Arduino IDE that does not work (httpCode = -1):</p>
  <pre><code>#include &lt;ESP8266WiFi.h&gt;
  #include &lt;ESP8266HTTPClient.h&gt;
  #include &lt;ArduinoJson.h&gt;
  
  char ssid[] = &quot;-------&quot;;
  const char* password =  &quot;------&quot;;
  
  void setup() 
  {
    Serial.begin(115200);
    WiFi.begin(ssid, password);
  
    while (WiFi.status() != WL_CONNECTED) 
    {
      delay(1000);
      Serial.println(&quot;Connecting...&quot;);
    }
  }
  
  void loop() 
  {
    if (WiFi.status() == WL_CONNECTED) 
    {
      HTTPClient http; //Object of class HTTPClient
      http.begin(&quot;https://api-football-v1.p.rapidapi.com/v2/fixtures/team/33/next/10&quot;);
      http.addHeader(&quot;x-rapidapi-key&quot;, &quot;-------&quot;);
      int httpCode = http.GET();
      Serial.println(httpCode);
      if (httpCode &gt; 0) 
      {
  
        Serial.println(http.getString());
  
      }
      http.end(); //Close connection
    }
    delay(60000);
  }
  
  </code></pre>
  <p>And here is the &quot;exact&quot; same code in python that works:</p>
  <pre><code>import requests
  
  url = &quot;https://api-football-v1.p.rapidapi.com/v2/fixtures/team/33/next/10&quot;
  
  
  headers = {
      'x-rapidapi-key': &quot;--------&quot;,
      }
  
  response = requests.request(&quot;GET&quot;, url, headers=headers)
  
  print(response.text)
  </code></pre>
  <p>I am veeeery new to programming in Arduino IDE, I only now python to be fair so my guess is that there are probably couple of mistakes in my code. Any ideas how to fix it?</p>