/* ESP32 WiFi Scanning example */

#include "WiFi.h"
#include <HTTPClient.h>


// Replace these with your WiFi credentials
const char *ssid = "Wokwi-GUEST";
const char *password = "";

void setup() {
  // Start serial communication
  Serial.begin(115200);

  // Connect to Wi-Fi
  connectToWiFi();
  
  // trying to fetch
  HTTPClient http;
  http.begin("https://people.math.sc.edu/Burkardt/data/bmp/bmp_24.bmp"); //EXAMPLE image from internet
  int httpCode = http.GET();
  int size = http.getSize();
  Serial.println(httpCode);
  Serial.println(size);
}

void connectToWiFi() {
  Serial.println("Connecting to WiFi");
  WiFi.begin(ssid, password, 6);

  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
}

void loop() {
  delay(10);
}