Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/for-get/know-your-http-well
HTTP headers, media-types, methods, relations and status codes, all summarized and linking to their specification.
https://github.com/for-get/know-your-http-well
emacs http http-header http-method http-status-code json
Last synced: 29 days ago
JSON representation
HTTP headers, media-types, methods, relations and status codes, all summarized and linking to their specification.
- Host: GitHub
- URL: https://github.com/for-get/know-your-http-well
- Owner: for-GET
- License: unlicense
- Created: 2013-04-16T14:15:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T17:07:31.000Z (4 months ago)
- Last Synced: 2024-10-15T00:22:14.569Z (29 days ago)
- Topics: emacs, http, http-header, http-method, http-status-code, json
- Language: Emacs Lisp
- Homepage:
- Size: 15.3 MB
- Stars: 2,396
- Watchers: 73
- Forks: 158
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# KNOW YOUR HTTP * WELL
HTTP encodings, headers, media types, methods, relations and status codes, all summarized and linking to their specification.
This project is used by [HyperREST bin](https://github.com/andreineculau/hyperrest-bin) at [bin.hyperrest.com](http://bin.hyperrest.com) .
## Table of Contents
- [SPECS](specs.md)
- [ENCODINGS](encodings.md)
- [HEADERS](headers.md)
- MEDIA TYPES
- [METHODS](methods.md)
- [RELATIONS](relations.md)
- [STATUS CODES](status-codes.md)## How to convert to other formats
* [pandoc](http://johnmacfarlane.net/pandoc/)
* [Marked](http://markedapp.com/)
* ...## Packages
### Emacs
```emacs
(require 'know-your-http-well)
;; M-x http-header ;; content-type
;; M-x http-method ;; post | POST
;; M-x http-relation ;; describedby
;; M-x http-status-code ;; 500
;; M-x http-status-code ;; not_found | NOT_FOUND
```### JavaScript
```javascript
var httpWell = require('know-your-http-well'),
statusWell = httpWell.statusPhrasesToCodes,
phraseWell = httpWell.statusCodesToPhrases;// on the server side
res.statusCode = statusWell.NOT_FOUND// on the client side
if (res.statusCode !== statusWell.OK) {
// Log "Request returned 404 Not Found"
log('Request returned ' + res.statusCode + ' ' + phraseWell[res.statusCode]);
}
```### JSON
Just take a look at [./json/*.json](json).
## References
* https://github.com/dret/webconcepts
* [DanaDanger on twitter.com](https://twitter.com/DanaDanger/status/183316183494311936): `HTTP response codes for dummies. 50x: we fucked up. 40x: you fucked up. 30x: ask that dude over there. 20x: cool.`
* [Steve Losh on twitter.com](https://x.com/stevelosh/status/372740571749572610?lang=en) : `HTTP status ranges in a nutshell: 1xx: hold on. 2xx: here you go. 3xx: go away. 4xx: you fucked up. 5xx: I fucked up`## License
[Unlicense](LICENSE).
## Stargazers over time
[![Stargazers over time](https://starchart.cc/for-GET/know-your-http-well.svg)](https://starchart.cc/for-GET/know-your-http-well)