Post image or file through form-data

Hello,

Can someone help me replicate this cURL in MIT App Inventor??

curl --location 'https://hughesenterprise.workfinity.com.br/api/serviceOrders/code/287677/attachments'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Authorization: ••••••'
--form 'file=@"/C:/Users/gdavanco/Downloads/cn.kevinkun.HttpUtil.aix"'

I tried 3 different methods, and unfortunatelly I couldn't find a solution.

Set Web1.Url to "https://hughesenterprise.workfinity.com.br/api/serviceOrders/code/287677/attachments"

Set Web1.RequestHeaders to make a list
    "Accept: application/json"
    "Authorization: Bearer your_token_here"

Call Web1.PostFile FilePicker1.File

Try this

A quick search in the community will provide this solution

Taifun

I tried, and this is the error I’m getting.

image

image

Look at the blocks the tool created, it's using post.text with an empty dict.

Do you have any other advice you could share?

Did you pick the file? What should be the accepted file path for this curl?