Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java HTTP Server Library

Tags:

java

I'm writing an application which needs to be able to handle HTTP requests from an external source (in this case, it's actually a script from Second Life). I started out by using HTTPComponents by Apache, which worked great as long as the Java server only had to respond to GET requests. Now it needs to be able to receive data from the body of POST requests, and I don't see any way to do so with HTTPComponents. Is there a superior library to use for this?

I did find through some Googling that there is a basic HTTP server included in the Sun packages. For the purposes of this application, it could be required that it only run on an actual Sun/Oracle JVM implementation -- but that's still a code smell to me, and I'd probably only do so if the only option was to write my own HTTP server library from scratch, working up from sockets and such. Any suggestions for an alternative?

like image 287
Thorn G Avatar asked Jan 22 '11 01:01

Thorn G


1 Answers

You can access the entity if the request is a HttpEntityEnclosingRequest. There is a simple example demonstrating the use of this class.

like image 119
Matthew Flaschen Avatar answered Sep 27 '22 22:09

Matthew Flaschen