How do I make a raw HTTP request in Java?

前端 未结 2 1774
天命终不由人
天命终不由人 2021-01-25 19:39

I want to make a basic HTTP request using these tokens: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

I know Java does it for you normally, but I want to specifi

相关标签:
2条回答
  • 2021-01-25 20:35

    Why reinvent the wheel ? The Apache Http Client 4 conforms to rfc2616.

    0 讨论(0)
  • 2021-01-25 20:40

    Open a socket to port 80 on the host you want to connect to, and then just write to the stream in the same way you'd write to a file or the console.

    0 讨论(0)
提交回复
热议问题