How to make a POST request with payload that includes a file?

Does anyone know how to include a file in a payload inside a POST call? I read this page and it doesnt seem to have this info. Perhaps Home Assistant api cant do it?

Anyway I can write a python script to do this as a service?

What i need to achieve:

  1. If motion detected then take a photo
  2. Make a POST request to my facial recognition service
  3. Examine the response for names
  4. Run another task like tell Alexa to say “Good Morning . Heres the weather and commute info”

Im currently stuck at 2

Try curl -T