Pico W - API endpoint

Hi there,

I’ve recently bought a Pico W and I would like to spin up an API endpoint on it in order to then control a robot.

The setup is simple (at least in my mind):

  • Spin up a server on a separate machine, hosting an HTML page that allows the user to send out API requests to the pico (initially pressing buttons, then integrating a controller through JS).
  • Spin up a server on the pico (micro python), which receives a JSON payload with each request and based on the values passed moves the motors/servos accordingly.

The servers are up and running and I can send out network requests to the Pico (pico server setup: https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf),

However, I don’t know how to access the payload part of the request (the actual body).
Is this supported in the library suggested in the documentation? (asyncio / uasyncio).

If not, is there a tested alternative that I could look into?

I’d like to keep the API/JSON approach as it’s structured and it would allow me to make changes down the line without having to rework the whole project.