HyperREST bin
A simple HTTP service with controlled behaviour, inspired by httpbin.
The service makes use of HTTP headers, and predominantly X-Prefer, in order to allow the client to control server behaviour.
Additionaly it also makes use of know-your-http-well and acts as a bookmarking tool for specification of HTTP status codes, headers, methods and relations.
This project is live at bin.hyperrest.com and has a search engine for convenience.
Install & run
npm install hyperrest-bin
hyperrest-bin
Usage
curl http://127.0.0.1:1337
curl http://127.0.0.1:1337/*
curl -XPOST http://127.0.0.1:1337
curl -XPOST -H"Accept: application/json" http://127.0.0.1:1337
curl -XPOST -H"Accept: application/xml" http://127.0.0.1:1337
curl -XTRACE http://127.0.0.1:1337
curl -XPOST -H"X-HTTP-Method-Override: TRACE" http://127.0.0.1:1337
curl -XTRACE -H"Accept: application/json" http://127.0.0.1:1337
curl -XTRACE -H"Accept: application/xml" http://127.0.0.1:1337
curl -H"Accept-Encoding: gzip,deflate" http://127.0.0.1:1337
curl -H"X-Prefer: status=404" http://127.0.0.1:1337
curl -H"X-Prefer: wait=10" http://127.0.0.1:1337
curl -H"X-Prefer: return-minimal" http://127.0.0.1:1337
curl -H"X-Prefer: return-representation" -H"Accept:text/html" http://127.0.0.1:1337
curl -H"X-Prefer: cookie=name1|v, cookie=name2|v" http://127.0.0.1:1337
curl -H"X-Prefer: cookie=name1" http://127.0.0.1:1337
curl -XPOST \
-H"Content-Type: application/json" \
-H"X-Prefer: return-request" \
-d'{"status":"200", \
"headers":{"Content-Type":"text/plain"}, \
"body":"TEXT"
}' http://127.0.0.1:1337
curl http://127.0.0.1:1337/method/{value}
curl http://127.0.0.1:1337/header/{value}
curl http://127.0.0.1:1337/statusCode/{value}
curl http://127.0.0.1:1337/rel/{value}
curl http://127.0.0.1:1337/spec/{value}
License
Apache 2.0.