import network
import urequests
import time
print("Conectando a la red", end="")
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect('Wokwi-GUEST', '')
while not sta_if.isconnected():
print("*", end="")
time.sleep(0.5)
print("\nConectado exitosamente")
api_url = "https://graph.facebook.com/v16.0/111290641852610/messages"
try:
print("Enviando requerimientos por HTTP...", end="")
response = urequests.get(api_url)
print(response.text)
response.close()
except Exception as e:
print("Error al conectar con la API:", e)