httputil

A handy HTTP endpoint for developers.

# Get your IP

$ curl https://httputil.dev/ip
{"host":"example.com", "ip":" 203.0.113.1"}

$ curl https://httputil.dev/ip/plain | cut -f1  # tab separated plain text
203.0.113.1
# Get status code
$ curl https://httputil.dev/200
OK
$ curl https://httputil.dev/404
Not Found

## Get JSON response
$ curl -H 'Accept:application/json' https://httputil.dev/200
# or
$ curl https://httputil.dev/200/json # Accept header will be ignored
{"message":"OK"}

## Get MessagePack response
$ curl -H 'Accept:application/msgpack' https://httputil.dev/200 | msgpack2json
# or
$ curl https://httputil.dev/200/msgpack | msgpack2json # Accept header will be ignored
{"message":"OK"}

## Get XML response
$ curl https://httputil.dev/200/xml
<?xml version="1.0" encoding="UTF-8"?>
<HTTPStatusResponse><Message>OK</Message></HTTPStatusResponse>

## get `pretty` output
$ curl https://httputil.dev/200/xml?pretty
<?xml version="1.0" encoding="UTF-8"?>
<HTTPStatusResponse>
  <Message>OK</Message>
</HTTPStatusResponse>
# Also available at httputil.com
$ curl https://httputil.com/200
OK

### We never store any data about your accesses to API. ###

see updates, make a pull request or share.