简体   繁体   中英

Java App to receive http PUT and Get request

I am looking for advice on how to go about writing a small and simple application that will receive http GET and http PUT request, process the data (simple text files) and respond.

I have all ready done this using threads and sockets but there must be a simpler and more efficient way. Also when I run my application using wireshark I am not convince I am using the http protocol as I should be.

Thanks
Alexis

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 server API.

I used HttpComponents for similar purposes - it provides functionality for HTTP server and client parts implementation. It's easy to learn and use.

如果您想获得HTTP解析的全部好处,则可以考虑嵌入诸如Jetty之类的网络服务器(从Java应用程序启动/停止)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM