title: How to get multiple responses per second with Get Request using ESP32
body: <p>I'm using an ESP32 controller to send Get requests to a page. I can get 1 response per second using the <code>http</code> protocol and one response every three seconds using <code>HTTPS</code>. I would like to get as many as 3 responses per second if possible. Is there a faster way to get these responses and is the problem with my ESP32, the code, or the server itself? I'm not sure if it helps but my ESP32 is sending the Get request to an ASP.NET application running on a Windows server through an Amazon Web Services EC2 instance. My API is simply returning true or false.</p>
  <p>Here is the code running on the ESP32:</p>
  <pre><code>#include &lt;Arduino.h&gt;
  #include &lt;WiFi.h&gt;
  #include &lt;WiFiMulti.h&gt;
  #include &lt;HTTPClient.h&gt;
  #define USE_SERIAL Serial
  
  WiFiMulti wifiMulti;
  
  //Certificate when using HTTPS
  /*
  const char* ca = \ 
  &quot;-----BEGIN CERTIFICATE-----\n&quot; \
  &quot;examplecertificate\n&quot; \
  &quot;-----END CERTIFICATE-----\n&quot; \
  */
  
  void setup() {
  
      USE_SERIAL.begin(115200);
      for(uint8_t t = 4; t &gt; 0; t--) {
          USE_SERIAL.printf(&quot;[SETUP] WAIT %d...\n&quot;, t);
          USE_SERIAL.flush();
          delay(1000);
      }
      wifiMulti.addAP(&quot;ssid&quot;, &quot;password&quot;);
  }
  
  void loop() {
      // wait for WiFi connection
      if((wifiMulti.run() == WL_CONNECTED)) {
  
          HTTPClient http;
          //USE_SERIAL.print(&quot;[HTTP] begin...\n&quot;);
          //http.begin(&quot;https://example.com/webapi/controller/getstatus/0&quot;, ca); //Using HTTPS takes 3 seconds
          http.begin(&quot;http://example.com/webapi/controller/getstatus/0&quot;); //Using HTTP takes 1 second
  
          //USE_SERIAL.print(&quot;[HTTP] GET...\n&quot;);
          // start connection and send HTTP header
          int httpCode = http.GET();
  
          // httpCode will be negative on error
          if(httpCode &gt; 0) {
  
              // file found at server
              if(httpCode == HTTP_CODE_OK) {
                  String payload = http.getString();
                  USE_SERIAL.println(payload);
              }
          } else {
              USE_SERIAL.printf(&quot;[HTTP] GET... failed, error: %s\n&quot;, http.errorToString(httpCode).c_str());
          }
          http.end();
      }
  }
  </code></pre>