c12
c12

Reputation: 9827

How do I setup the request for multipart/form file upload with jax-rs?

I have the below setup but I'm unsure how to test the service. I'm not sure how to setup the request, the request headers, request body, form params, content type...etc. I've always use the google rest client, but maybe thats not appropriate for this use case.

How do I do a multipart/form file upload with jax-rs?

Upvotes: 0

Views: 2319

Answers (1)

Adrian Rodriguez
Adrian Rodriguez

Reputation: 3242

You can use Firefox Poster or a real simple test would be for you to create a form in HTML and submit it. You'll want to change the name of the file to whatever you are looking for in your service.

<form action="yourservicecall" method="post" enctype="multipart/form-data">
    <label for="file">Filename:</label>
    <input type="file" name="file" id="file" />
    <br />
    <input type="submit" name="submit" value="Submit" />
</form>

Upvotes: 1

Related Questions