13

does anyone know a little test tool (like Poster / RestTool for Firefox) that is able to upload a file and send a text body within the same post request (Multipart)?

SeBo
  • 275
  • 1
  • 3
  • 10

5 Answers5

10

It is not a firefox-addon, but what I can really recommend is to use curl tool. It fits perfect when playing around with RESTful HTTP APIs because it is very close to HTTP protocol. Because it is CLI based it is more flexible as graphical addon (e.g. you can mail around or can document your api with sample calls).

E.g. doing a multipart request with curl would be:


# with '-v' verbose-switch you see some headers
# with '-F' you are "activating" single multiparts
# with '@' you are referencing file
curl -v -F myPartName1=@file1.txt -F myPartName2=@file2.txt http://host.com/your/multipart/endpoint

# if server needs it you can also pass Content-Type with single files
... -F "myPartName1=@file1.txt;type=text/plain" ...

What kind of multipart do you expect on server-side (e.g. multipart/form-data or multipart/mixed).

Is there a reason why it has to be a firefox addon? I have seen people using RestClient, but I never saw it working with multipart.

manuel aldana
  • 15,650
  • 9
  • 43
  • 50
  • After a minute of googling i still don´t get the difference between multipart/form-data and multipart/mixed. But i develope the server-side AND the client side and so have full control over the communication. What i want to do is sent 1 or more files to a PHP script but also send some Key-Values within the Post. Important to me is that the file is present within the global $_FILES variable and the key-value pairs are in $_POST. – SeBo Sep 16 '11 at 11:21
2

You can use Firefox poster add-on to send HTTP posts with multipart.

  1. Select "Parameters" tab
  2. Enter the multipart "Name" and "Value"
  3. Press "Add/Change"
  4. Select "Content to Send" tab
  5. Press "Body from Parameters"
  6. Enter your URL and User Auth, as required
  7. Press"POST"
mike_m
  • 1,526
  • 4
  • 14
  • 19
Joff
  • 47
  • 2
2

For Chrome/Chromium there is the excellent Postman app/extension: http://www.getpostman.com/ .

For a brief visual tutorial you can check: https://stackoverflow.com/a/16022213/1667104 .

Community
  • 1
  • 1
lgaggini
  • 421
  • 4
  • 13
0

Firefox has a few:

and poster as mentioned earlier by @joff

Noitidart
  • 35,443
  • 37
  • 154
  • 323
0

I like to include http://aminus.net/wiki/Okapi in most of my HTTP projects these days.

fumanchu
  • 14,419
  • 6
  • 31
  • 36