DO NOT COMPARE THIS WITH CURL OR INSOMNIA OR POSTMAN :)
this is a simple http client for internet engineering course. it will send string to server by socket in port 80.
learn more about project in todo.pdf
- install jdk11+
- compile with
javac Main.java
- run with
java Main
- enter request url (only http 1.0 supported. no https)
- enter method (please use
get
:) ) - wait for server response.
- answer would be something like this:
==============HttpResponse==========
version = HTTP/1.1
errorCode = 200
errorDesc = OK
headers = {Server=gunicorn/19.9.0, Access-Control-Allow-Origin=*, Access-Control-Allow-Credentials=true, Connection=close, Content-Length=248, Date=Sun, 10 Jan 2021 16:45:31 GMT, Content-Type=application/json}
-------body--------
{
"args": {},
"headers": {
"Accept": "*/*",
"Content-Length": "0",
"Host": "httpbin.org",
"X-Amzn-Trace-Id": "Root=1-5ffb2f2a-40a054d36ab2677f3214b6a7"
},
"origin": "5.113.239.236",
"url": "http://httpbin.org/get"
}
----end of body----
==========End Of HttpResponse=======
- note that httpbin is a very good site for demonstrating this program features.
another implementation of this project could be found here