Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST API Single Request - Multiple responses

Tags:

I am writing a REST API in JAX-RS 2.0, JDK 8 for the below requirement

POST API /server/fileUpload/ (Multipart Form data) where I need to send a Big .AI (Adobe Illustrator) File in this.

The Server, takes the file and return Status 202 (Accepted), Acknowledging that file transfer happened Successfully. (From endpoint to Server)

Now at the Server, I am using Java + Imagemagik to convert .AI File (20-25 MB File) to small JPG Thumbnail, place on a Apache HTTP Server and share the location (like http://happyplace/thumbnail0987.jpg)

Now the Second Response should come from Server with Status 200 OK and Thumbnail URL

is it feasible with one REST API? (Async/similar)

or should I split it to 2 API calls, Please suggest

like image 884
Sandeep540 Avatar asked Oct 14 '17 18:10

Sandeep540


1 Answers

No. In http, one request gets one response. The client must send a second request to get a second response.

like image 156
DwB Avatar answered Oct 11 '22 13:10

DwB