-
-
Save mamund/624329 to your computer and use it in GitHub Desktop.
forked version of mikekelly's very cool idea of a microformat for HTTP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Example of HTTP microformat</title> | |
<meta name="author" content="[email protected]" /> | |
<style type="text/css"> | |
dl.http | |
{ | |
border: 1px solid black; | |
} | |
dl.http dt.request, | |
dl.http dd.request, | |
dl.http dt.response, | |
dl.http dd.response | |
{ | |
margin:0; | |
padding:0 .2em; | |
background-color:silver; | |
} | |
p.header, | |
p.line | |
{ | |
margin:0; | |
padding:0; | |
} | |
p.header span.field, | |
p.line span.method | |
{ | |
font-weight:bold; | |
} | |
</style> | |
</head> | |
<body> | |
<dl class="http"> | |
<!-- request --> | |
<dt class="request"> | |
<p class="line"> | |
<span class="method">POST</span> | |
<span class="resource">/foo/bar</span> | |
<span class="http-version">HTTP/1.1</span> | |
</p> | |
</dt> | |
<dd class="request"> | |
<p class="header"> | |
<span class="field">Host</span>: | |
<span class="value">www.example.org</span> | |
</p> | |
<p class="header"> | |
<span class="field">If-None-Match</span>: | |
<span class="value">123123123123</span> | |
</p> | |
<pre class="body">{ "foo" : "bar" }</pre> | |
</dd> | |
<!-- response --> | |
<dt class="response"> | |
<p class="line"> | |
<span class="http-version">HTTP/1.1</span> | |
<span class="status">200 OK</span> | |
</p> | |
</dt> | |
<dd class="response"> | |
<p class="header"> | |
<span class="field">Content-Type</span>: | |
<span class="value">application/json</span> | |
</p> | |
<p class="header"> | |
<span class="field">ETag</span>: | |
<span class="value">321321321321</span> | |
</p> | |
<pre class="body">{ "boo" : "doo" }</pre> | |
</dd> | |
</dl> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Example of HTTP microformat</title> | |
<meta name="author" content="[email protected]" /> | |
<style type="text/css"> | |
dl.http | |
{ | |
border: 1px solid black; | |
} | |
dl.http dt.request, | |
dl.http dd.request, | |
dl.http dt.response, | |
dl.http dd.response | |
{ | |
margin:0; | |
padding:0 .2em; | |
background-color:silver; | |
} | |
span.header, | |
span.line | |
{ | |
display:block; | |
} | |
span.header span.field, | |
span.line span.method | |
{ | |
font-weight:bold; | |
} | |
</style> | |
</head> | |
<body> | |
<dl class="http"> | |
<!-- request --> | |
<dt class="request"> | |
<span class="line"> | |
<span class="method">POST</span> | |
<span class="resource">/foo/bar</span> | |
<span class="http-version">HTTP/1.1</span> | |
</span> | |
</dt> | |
<dd class="request"> | |
<span class="header"> | |
<span class="field">Host</span>: | |
<span class="value">www.example.org</span> | |
</span> | |
<span class="header"> | |
<span class="field">If-None-Match</span>: | |
<span class="value">123123123123</span> | |
</span> | |
<pre class="body">{ "foo" : "bar" }</pre> | |
</dd> | |
<!-- response --> | |
<dt class="response"> | |
<span class="line"> | |
<span class="http-version">HTTP/1.1</span> | |
<span class="status">200 OK</span> | |
</span> | |
</dt> | |
<dd class="response"> | |
<span class="header"> | |
<span class="field">Content-Type</span>: | |
<span class="value">application/json</span> | |
</span> | |
<span class="header"> | |
<span class="field">ETag</span>: | |
<span class="value">321321321321</span> | |
</span> | |
<pre class="body">{ "boo" : "doo" }</pre> | |
</dd> | |
</dl> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Example of HTTP microformat</title> | |
<meta name="author" content="[email protected]" /> | |
<style type="text/css"> | |
dl.http | |
{ | |
border: 1px solid black; | |
} | |
dl.http dt.request, | |
dl.http dd.request, | |
dl.http dt.response, | |
dl.http dd.response | |
{ | |
margin:0; | |
padding:0 .2em; | |
background-color:silver; | |
} | |
ul.line | |
{ | |
list-style:none; | |
margin:0; | |
padding:0; | |
} | |
ul.line li | |
{ | |
display:inline; | |
} | |
span.header | |
{ | |
display:block; | |
} | |
span.header span.field, | |
ul.line li.method | |
{ | |
font-weight:bold; | |
} | |
</style> | |
</head> | |
<body> | |
<dl class="http"> | |
<!-- request --> | |
<dt class="request"> | |
<ul class="line"> | |
<li class="method">POST</li> | |
<li class="resource">/foo/bar</li> | |
<li class="http-version">HTTP/1.1</li> | |
</ul> | |
</dt> | |
<dd class="request"> | |
<span class="header"> | |
<span class="field">Host</span>: | |
<span class="value">www.example.org</span> | |
</span> | |
<span class="header"> | |
<span class="field">If-None-Match</span>: | |
<span class="value">123123123123</span> | |
</span> | |
<pre class="body">{ "foo" : "bar" }</pre> | |
</dd> | |
<!-- response --> | |
<dt class="response"> | |
<ul class="line"> | |
<li class="http-version">HTTP/1.1</li> | |
<li class="status">200 OK</li> | |
</ul> | |
</dt> | |
<dd class="response"> | |
<span class="header"> | |
<span class="field">Content-Type</span>: | |
<span class="value">application/json</span> | |
</span> | |
<span class="header"> | |
<span class="field">ETag</span>: | |
<span class="value">321321321321</span> | |
</span> | |
<pre class="body">{ "boo" : "doo" }</pre> | |
</dd> | |
</dl> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Example of HTTP microformat</title> | |
<meta name="author" content="[email protected]" /> | |
<style type="text/css"> | |
dl.http | |
{ | |
border: 1px solid black; | |
} | |
dl.http dt.request, | |
dl.http dd.request, | |
dl.http dt.response, | |
dl.http dd.response | |
{ | |
margin:0; | |
padding:0 .2em; | |
background-color:silver; | |
} | |
ul.line | |
{ | |
list-style:none; | |
margin:0; | |
padding:0; | |
} | |
ul.line li | |
{ | |
display:inline; | |
} | |
dl.headers | |
{ | |
margin:0; | |
padding:0; | |
} | |
dl.headers dt | |
{ | |
display:block; | |
width:125px; | |
float:left; | |
} | |
dl.headers dt.field, | |
ul.line li.method | |
{ | |
font-weight:bold; | |
} | |
</style> | |
</head> | |
<body> | |
<dl class="http"> | |
<!-- request --> | |
<dt class="request"> | |
<ul class="line"> | |
<li class="method">POST</li> | |
<li class="resource">/foo/bar</li> | |
<li class="http-version">HTTP/1.1</li> | |
</ul> | |
</dt> | |
<dd class="request"> | |
<dl class="headers"> | |
<dt class="field">Host</dt> | |
<dd class="value">www.example.org</dd> | |
<dt class="field">If-None-Match</dt> | |
<dd class="value">123123123123</dd> | |
</dl> | |
<pre class="body">{ "foo" : "bar" }</pre> | |
</dd> | |
<!-- response --> | |
<dt class="response"> | |
<ul class="line"> | |
<li class="http-version">HTTP/1.1</li> | |
<li class="status">200 OK</li> | |
</ul> | |
</dt> | |
<dd class="response"> | |
<dl class="headers"> | |
<dt class="field">Content-Type</dt> | |
<dd class="value">application/json</dd> | |
<dt class="field">ETag</dt> | |
<dd class="value">321321321321</dd> | |
</dl> | |
<pre class="body">{ "boo" : "doo" }</pre> | |
</dd> | |
</dl> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created a RDFa version here https://gist.github.com/703225. Perhaps not quite as simple, but it has the advantage that it works in RDFa parsers such as http://www.w3.org/2007/08/pyRdfa/ today rather than having to wait for people to implement a microformat.