s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266
https://valencia.lbsfilm.at/midterm-presentation/
Other
923 stars 174 forks source link

Is it possible to trigger an external API request? #166

Closed daniel-frenkel closed 2 years ago

daniel-frenkel commented 2 years ago

This GUI is incredible. I currently use AsyncTCP to trigger GET requests. For example, I'll send this from a different device to trigger a movement.

http://192.168.4.1/position?move=100

Is it possible to send HTTP requests to change the values of something like a slider or switch?

thomastech commented 2 years ago

Yes, very possible. I'm doing exactly that with ESPUI.

Port 80 is used by ESPUI, so you'll need to use port 8080 for WiFi Server GET. Other than that, nothing unusual needs to be coded.

BTW, this means your URL would look like this when sending to port 8080: http://192.168.4.1:8080/position?move=100

daniel-frenkel commented 2 years ago

Yes, very possible. I'm doing exactly that with ESPUI.

Port 80 is used by ESPUI, so you'll need to use port 8080 for WiFi Server GET. Other than that, nothing unusual needs to be coded.

BTW, this means your URL would look like this when sending to port 8080: http://192.168.4.1:8080/position?move=100

  • Thomas

Thank you!

That worked out perfectly

Atorcha commented 1 year ago

Can we change the port 80?

iangray001 commented 1 year ago

Yes, it is an argument to the begin functions. See here.

ESPUI.begin(HOSTNAME, 0, 0, 12345); to set port 12345.