{{ handler.settings['site_title'] }}

Simple service for testing HTTP/HTTPS requests. All endpoint responses are JSON-encoded exclude /status/{status_code: int}. It's useful for testing how your own scripts deal with varying responses and requests.

AUTHOR

Lispython (Follow me on github)

SOURCE

You can get sources of h.wrttn.me on http://github.com/Lispython/httphq

ENDPOINTS

HTTP status codes

EXAMPLES

curl http://{{ handler.request.host }}/get | python -mjson.tool


{
    "args": {},
    "headers": {
        "Accept": "*/*",
        "Host": "{{ handler.request.host }}",
        "User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
    },
    "url": " http://{{ handler.request.host }}/get"
}

curl -X POST -F "name=value" http://{{ handler.request.host }}/post | python -mjson.tool


{
    "args": {
        "name": [
            "value"
        ]
    },
    "body": "------------------------------eb288eb3d3e4\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nvalue\r\n------------------------------eb288eb3d3e4--\r\n",
    "files": {},
    "headers": {
        "Accept": "*/*",
        "Content-Length": "144",
        "Content-Type": "multipart/form-data; boundary=----------------------------eb288eb3d3e4",
        "Expect": "100-continue",
        "Host": "{{ handler.request.host }}",
        "User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
    },
    "ip": "127.0.0.1",
    "request_time": 0.04458308219909668,
    "start_time": 1313996082.806412,
    "url": "http://{{ handler.request.host }}/post"
}
	  

curl -X POST -F "test_files=@/tmp/testfile1.txt" -F "test_files=@/tmp/testfile2.txt" http://{{ handler.request.host }}/post | python -mjson.tool


{
    "args": {},
    "files": {
        "pictures": [
            {
                "body": ";klrjewfghjnq3rjehg;fqnr___j3bnr4lgfbv4riy5bguy4br5y\n",
                "content_type": "text/plain",
                "filename": "testfile1.txt"
            },
            {
                "body": ";klrlfkejwknfqwdrkjnbkfgjb3erj\n",
                "content_type": "text/plain",
                "filename": "testfile2.txt"
            }
        ]
    },
    "body": "",
    "headers": {
        "Accept": "*/*",
        "Content-Length": "428",
        "Content-Type": "multipart/form-data; boundary=----------------------------af3ea881bfa9",
        "Expect": "100-continue",
        "Host": "{{ handler.request.host }}",
        "User-Agent": "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
    },
    "ip": "127.0.0.1",
    "request_time": 0.04804205894470215,
    "start_time": 1313953495.331477,
    "url": "http://{{ handler.request.host }}/post"
}

SOURCE

You can get sources of h.wrttn.me on http://github.com/Lispython/httphq

SEE ALSO

human cURL — fast python library for resources requests.

httpbin.org, http://postbin.org/, http://httpstat.us, ifconfig.me,http://hurl.it/

THANKS

To Kenneth Reitz who develop httpbin.org

Request time: {{ handler.request.request_time()*1000 }} ms