Using httpbin to test http and https requests
StackOverflow user Kenneth Reitz has written a great on-line and free httpbin tool that responds to many kinds of http/https requests including the standaard http request methods (or verbs) used by REST: get, post (for http 1.0) and patch, put, delete (for http 1.1).
These verbs are not supported: head (http 1.0) and trace, options, connect (http 1.1).
The site is geared towards JSON (as most the responses are in JSON, except for one XML response and a few TEXT responses), but even if your environment does not use JSON, it is very useful as you basically get an echo of information on what you pass to it.
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.4])
AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" = JYFOYIFOIYFGYyofiyfoiy oiyfoiyfo oiyugfsdoiygfosi oiusgdfoisdyug oiyugsdofiuysgodfi oiusgdf"xyes"])</pre>
In the Makefiles, we have to leverage these information to:- Conditionally distribute NLS-related files such as ABOUT-NLS:
if USE_NLS dist_doc_DATA += ABOUT-NLS endif
Except one endpoint (/encoding/utf8), none of the response encodings can be determined by the request. This is a pity as sometimes it is good to see how a specific encoding works for JSON, but it is very hard to support encodings well, so I can understand the support is not there (or not there yet).
There are many examples on the site, which I won’t list.
What I do list are the endpoints as copied from the site on 20141228:
/This page./ipReturns Origin IP./user-agentReturns user-agent./headersReturns header dict./getReturns GET data./postReturns POST data./patchReturns PATCH data./putReturns PUT data./deleteReturns DELETE data/encoding/utf8Returns page containing UTF-8 data./gzipReturns gzip-encoded data./deflateReturns deflate-encoded data./status/:codeReturns given HTTP Status code./response-headers?key=valReturns given response headers./redirect/:n302 Redirects n times./redirect-to?url=foo302 Redirects to the foo URL./relative-redirect/:n302 Relative redirects n times./cookiesReturns cookie data./cookies/set?name=valueSets one or more simple cookies./cookies/delete?nameDeletes one or more simple cookies./basic-auth/:user/:passwdChallenges HTTPBasic Auth./hidden-basic-auth/:user/:passwd404’d BasicAuth./digest-auth/:qop/:user/:passwdChallenges HTTP Digest Auth./stream/:nStreams n–100 lines./delay/:nDelays responding for n–10 seconds./drip?numbytes=n&duration=s&delay=s&code=codeDrips data over a duration after an optional initial delay, then (optionally) returns with the given status code./htmlRenders an HTML Page./robots.txtReturns some robots.txt rules./denyDenied by robots.txt file./cacheReturns 200 unless an If-Modified-Since or If-None-Match header is provided, when it returns a 304./cache/:nSets a Cache-Control header for n seconds./bytes/:nGenerates n random bytes of binary data, accepts optional seed integer parameter./stream-bytes/:nStreams n random bytes of binary data, accepts optional seed and chunk_size integer parameters./links/:nReturns page containing n HTML links./forms/postHTML form that submits to /post/xmlReturns some XML
via: HTTP Test server that accepts GET/Post calls – Stack Overflow.
| Reference: | Using httpbin to test http and https requests from our NCG partner Jeroen Pluimers at the The Wiert Corner blog. |



