Network Deployment (Distributed operating systems), v8.0 > End-to-end paths > Web services - RESTful services


 Using multipart/form-data content in JAX-RS application requests and responses

A frequently used content type for submitting files through an HTML form is multipart/form-data. The IBM Java API for RESTful Web Services (JAX-RS) implementation greatly simplifies the processing of such data by automatically splitting the parts and automatically decoding them. If such automatic processing is not desired, the resource may instead receive the parts in an object so processing of the parts is under the complete control of the resource method. JAX-WS

This task shows you how to develop a JAX-RS resource that takes advantage of the IBM JAX-RS implementation features that automatically split and decode the parts in a multipart/form-data HTTP form submission. Using these features allows a JAX-RS resource method to receive a File object, freeing the method from having to process the raw part payloads itself. You also see how to receive the raw data so that, if desired, the JAX-RS resource method retains complete control of the processing of the raw part data.


Procedure

  1. Configure the development environment.

  2. Define the resources in JAX-RS web applications.

  3. Configure the JAX-RS application.

  4. Implement a resource method to receive multipart/form-data parts from an HTML form submission.

  5. Assemble JAX-RS web applications.

  6. Deploy JAX-RS web applications.


Results

You have developed and deployed a JAX-RS web application on the application server that processes multipart/form-data content for requests and responses.



Related tasks

Configure a resource to receive multipart/form-data parts from an HTML form submission
JSON4J libraries

Related reference

Web services specifications and APIs









+

Search Tips   |   Advanced Search