How to send a photo to a rest service
What is the best approach to be able to send a photo from the iPhone client to a rest service (jax-rs) and save it from there? This is my current server code:
@POST
@Path("/newPhoto/{eventId}")
@Consumes("application/octet-stream")
public void newPhoto (@PathParam("eventId") String eventID,
开发者_如何学Go InputStream pict)
throws Exception
{
// save photo
}
Is this ok or do you recommend something else? And how can I test this service on terminal with curl command?
It looks good for me. Usually, I would put the InputStream as first param, but I checked and it's OK.
精彩评论