2

At the question:

How to expose a Restful Endpoint in Play Framework for uploading a File and Posting a JSON at the same time?

I wanted to know how in one Single HTTP request POST/ I could upload a file and send a Json. My intention was to maintain my API restful.

After some research, I came across the following answer, that basically suggests to post the metadata firstly and then post the file as multi-part, like in two separate operation, associating the two:

How do I upload a file with metadata using a REST web service?

My question is, how can I do this as an Atomic Operation in My Restful API?

Since I am having 2 steps to finish up the operation, how do I ensure I don;t process the metadata without the file, in case the second post(upload) with the file is not performed by the client?

What are my architectural choices?

I am using Play Framework 2.5 with Scala (no views, completely restful)

Community
  • 1
  • 1
Filipe Miranda
  • 914
  • 1
  • 20
  • 33
  • 1
    Is this a duplication of [your other question](http://stackoverflow.com/questions/38030373/how-to-expose-a-restful-endpoint-in-play-framework-for-uploading-a-file-and-post)? If so, I suggest you to close/remove one of them to avoid splitting the discussion. – marcospereira Jun 28 '16 at 03:31
  • @marcospereira - No it's not, in the other question I am asking how to do in one single HTTP request, no round trips... Here I am asking how to manage to HTTP POST requests. – Filipe Miranda Jun 28 '16 at 16:04
  • Have you found any response, that you like to share ? – Ambroise Rabier Jun 25 '22 at 17:09

0 Answers0