Help with uplaod a file using API

Task: Upload a file using API

Trying to upload a file using API. I have the superfast.HTML created locally. Have everything ready except not sure how to write the JSON for the body of the request.

Hello @Ron_Mansolo

You can use this doc

Regards, Vlad

Sorry, my fault for not being specific. I’m using the REST API. Here is the instruction I need help with:

Request Body:¶
File contents formatted per the multipart/form-data requirements.

Hi, @Ron_Mansolo

Here is a doc for REST
You need to select a request header
Content-Type: multipart/form-data
In Body select form-data and choose the Superfast.html file from your laptop.


Sorry for my continued confusion.

I’ve got header set to Content-Type: multipart/form-data.
The issue is the correct Javascript for the Body. Something like:

Hello @Ron_Mansolo

You should use “form-data” body. Your cURL should look like this:

curl --location --request POST ‘
–header ‘Content-Type: multipart/form-data’
–form ‘=@"/home/user/superfast.html"’