0

I created simple Rest service to upload a file (in Spring web application), method looks like below:

    @POST
    @Path("/job/upload")
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Produces({ "application/json; charset=UTF-8" })
    public Response upload(List<Attachment> attachments) {

        LOG.info("Upload new picture to!");
        // some unimportant code
 }

I try to test it by RESTClient - Firefox plugin. When call this rest service I see : Status Code: 415 Unsupported Media Type. enter image description here

How can I test it? Can I add sample file in RESTClient and how can I do it?

tostao
  • 2,803
  • 4
  • 38
  • 61
  • is this plugin supports file upload test? if you are using intellij idea , they have Rest Client for testing file upload. you can find it under Tools-> test restful Web Service. – Nikolay Rusev Jul 15 '15 at 09:13
  • 1
    What does the request look like? You should be able to see the complete request. That would help. You can also check out [Chrome's Postman](http://stackoverflow.com/a/27614403/2587435). Multipart support is pretty easy to work with. – Paul Samsotha Jul 15 '15 at 16:26

0 Answers0