2

I'm currently creating a Java application for my image hosting service. The application is supposed to send images via HTTP to my web app, my web app processes and uploads the image and sends back a response to the Java application.

In theory, I know how the process would go, but in practice, it's something I've never tried before and I don't know where to start looking. I've read several articles that explain how to make a HTTP request to the web, but I found nothing that explained how to send images/files over via that HTTP request.

A few examples and some sources would be a great head start. I'd appreciate your help.

aborted
  • 4,481
  • 14
  • 69
  • 132
  • possible duplicate of [How do I send an image file in a Http POST request? (java)](http://stackoverflow.com/questions/6016086/how-do-i-send-an-image-file-in-a-http-post-request-java) – helderdarocha Jun 17 '14 at 14:33
  • Apparently, that question you linked to does not have an accepted answer, therefore I cannot take it for correct. Please reconsider your close request @helderdarocha – aborted Jun 17 '14 at 14:34
  • 1
    See the link. You can use Commons HTTP Client from any Java code: http://hc.apache.org/httpclient-3.x/tutorial.html . If you actually need a REST Webservice client, you might consider using a Jersey client. – helderdarocha Jun 17 '14 at 14:35
  • 1
    Well, it actually is a valid answer and should work. You might want to try a simple HTTP Client POST request before sending attachments. Take a look at this answer: http://stackoverflow.com/questions/10604001/how-to-send-simple-http-post-request-with-post-parameters-in-java/10607366#10607366 – helderdarocha Jun 17 '14 at 14:42

0 Answers0