$ curl 127.0.0.1:8033 3.22.194.5 $ http -b 127.0.0.1:8033 3.22.194.5 $ wget -qO- 127.0.0.1:8033 3.22.194.5 $ fetch -qo- https://127.0.0.1:8033 3.22.194.5 $ bat -print=b 127.0.0.1:8033/ip 3.22.194.5
$ http 127.0.0.1:8033/country 美国
$ http 127.0.0.1:8033/city 哥伦布
$ http 127.0.0.1:8033/json { "city": "哥伦布", "country": "美国", "ip": "3.22.194.5", "ip_decimal": 51823109 }
Setting the Accept header to application/json also works.
Always returns the IP address including a trailing newline, regardless of user agent.
$ http 127.0.0.1:8033/ip 3.22.194.5
$ http 127.0.0.1:8033/port/8080 { "ip": "3.22.194.5", "port": 8080, "reachable": false }