3

I am trying to use RESTClient Firefox add on to post something equivalent to this:

curl -s -S -X POST -H "Content-type: application/zip" \
  --data-binary @./cluster-config.zip \
  http://${JOINING_HOST}:8001/admin/v1/cluster-config

The idea is using this Firefox add-on (RESTClient) to debug my stuff until it works. But I am stuck because I don't find the way to add a file to the request (equivalent to --data-binary parameter of curl)

How can I include a file in the request in RestClient Firefox add-on?

shA.t
  • 16,580
  • 5
  • 54
  • 111
Oscar Foley
  • 6,817
  • 8
  • 57
  • 90
  • One option is `nsIFormData`: http://stackoverflow.com/q/25040513/1828637 I'm pretty sure doing implementation of it via XPCOM in a fully featured `xhr` function I use regularly and just used a couple days ago is here: https://github.com/Noitidart/NativeShot/blob/b6e0eec22790c719dab1a781bf2e5f14ddf87887/bootstrap.js#L1403-L1407 its commented out though as I opted for `DataURL`/`base64` – Noitidart Jul 14 '15 at 15:20
  • Postman provides a way to that as explained here: https://stackoverflow.com/questions/39037049/how-to-upload-a-file-and-json-data-in-postman, unfortunately, I didn't find such an option in the GUI of the Firefox RESTClient extension. – belgoros Jan 27 '23 at 08:48

0 Answers0