$ curl 127.0.0.1:8033 216.73.217.131 $ http -b 127.0.0.1:8033 216.73.217.131 $ wget -qO- 127.0.0.1:8033 216.73.217.131 $ fetch -qo- https://127.0.0.1:8033 216.73.217.131 $ bat -print=b 127.0.0.1:8033/ip 216.73.217.131
$ http 127.0.0.1:8033/country 美国
$ http 127.0.0.1:8033/city 波莫纳
$ http 127.0.0.1:8033/json
{
"city": "波莫纳",
"country": "美国",
"ip": "216.73.217.131",
"ip_decimal": 3628718467
}
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 216.73.217.131
$ http 127.0.0.1:8033/port/8080
{
"ip": "216.73.217.131",
"port": 8080,
"reachable": false
}