Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtojek/http-status
Use more API-friendly http.StatusText(...) messages.
https://github.com/mtojek/http-status
Last synced: 27 days ago
JSON representation
Use more API-friendly http.StatusText(...) messages.
- Host: GitHub
- URL: https://github.com/mtojek/http-status
- Owner: mtojek
- License: apache-2.0
- Created: 2016-07-30T09:57:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-30T10:21:34.000Z (over 8 years ago)
- Last Synced: 2024-11-03T06:06:06.256Z (2 months ago)
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-status
[![Build Status](https://travis-ci.org/mtojek/http-status.svg?branch=master)](https://travis-ci.org/mtojek/http-status)
Use more API-friendly http.StatusText(...) messages.
Status: **Done**
If you agree that standard HTTP status texts do not conform to the nature of API responses, please check this library and start using HTTP status text codes instead.
| HTTP status code | HTTP status text | HTTP status text code |
|:----------------:|:---------------------:|:---------------------:|
| 404 | Not Found | NOT_FOUND |
| 418 | I'm a teapot | I_M_A_TEAPOT |
| 500 | Internal Server Error | INTERNAL_SERVER_ERROR |## Usage
~~~ go
import "github.com/mtojek/http-status"var statusTextCode string
statusTextCode = status.TextCode(http.StatusInternalServerError) // statusTextCode = "INTERNAL_SERVER_ERROR"
~~~