Jump to content

POSTing a file with metadata to a RESTful Web Service


proggR

Recommended Posts

I'm building a RESTful web service that is essentially just an intermediary between a client and a mainframe. I have all of the GET requests working but the crux of the service is going to be the ability to POST a file to the service to be handled. I'm writing it in Java but an answer in any language would be helpful.

 

I need the web service to be able to accept a POST request to the address localhost/project/{userid}/ which will contain a file and meta data about that file.

The easiest way to do that would be able to construct an XML schema and have the file attached to the XML as some kind of MIME attachment. The issues with that are:

1 - its not common to send XML to a restful service

2 - I'm not sure what the web service should be expecting for a parameter type if the message body is XML with an attachment

3 - I don't know how to attach/unattach a MIME attachment to XML to test the service

 

I'm fairly new to RESTful web services and I'll admit my XML abilities are a tad weak as well. Any help would be greatly appreciated.

Thanks in advance.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.