Java application for receiving HTTP PUT and Get requests

I am looking for advice on how to write a small and simple application that will receive an HTTP GET request and HTTP PUT, process the data (plain text files) and respond.

I am all ready to do this with threads and sockets, but there should be a simpler and more efficient way. Also, when I launch my application using wirehark, I am not convinced that I am using the http protocol, as it should be.

thanks
Alexis

+4
source share
3 answers

You can use Tiny Java Web Server. ( http://tjws.sourceforge.net/ )

Alternatively, if you are using Java 6 or later, you can use the Http API.

+1
source

I used HttpComponents for similar purposes - it provides functionality for implementing the HTTP server and client parts. It is easy to learn and use.

+1
source

You might consider embedding a web server such as Jetty (starting / stopping it from a java application) if you want to get all the benefits of HTTP parsing.

0
source

All Articles