Http multipart form request

Hello,
I want to upload a file to a web server from esp 8266. Can you guide me to upload the file using c codes. I have referred the http multipart form request function in documentation, but I couldn’t figure out any solution.
I have achieved uploading the files in that server using curl commands. But I want the upload to take place by its own. Please help me.
Also, I want to know whether curl commands can be executed from the main.c file.
Thank you for reading my query.

Have a look at mgos_prometheus_metrics_pushgateway.c

AFAIK, curl is not ported to Mongoose OS.

Thank you for your response. I will check the link