Wirking on exploring this issue: w3c/wptserve#84
$ pip install wptserve
$ python test.py
http://localhost:8080/
Elsewhere...
$ curl -v http://localhost:8080/ -H 'Prefer: respond-async, wait=100' -H 'Prefer: handling=l
enient'
* Trying ::1...
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.41.0
> Host: localhost:8080
> Accept: */*
> Prefer: respond-async, wait=100
> Prefer: handling=lenient
>
< HTTP/1.1 200 OK
< Server: BaseHTTP/0.3 Python/2.7.10
< Date: Fri, 15 Jul 2016 18:10:01 GMT
< Content-Length: 187
<
{
"accept": [
"*/*"
],
"host": [
"localhost:8080"
],
"prefer": [
"handling=lenient"
],
"user-agent": [
"curl/7.41.0"
]
}* Connection #0 to host localhost left intact
Example usage from RFC 7240.