Analysis of curl request parameters

curl "https://a.com?filename=myfile.dat&token=123" \
  -v -u {email_address}:{password} \
  -H "Content-Type: application/binary" \
  --data-binary @file.dat -X POST

how can this curl request be parsed into a post format that js can use?

var formdata = new FormData();
formdata.append("filename",file);
formdata.append("token","123");

I write this, request error: 422 Unprocessable Entity

Feb.28,2021

this is a file upload, and the front end cannot be done only through JS. You need to select the uploaded file.

Menu