Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ferhatelmas/httpclass

Get class of a HTTP code
https://github.com/ferhatelmas/httpclass

Last synced: 26 days ago
JSON representation

Get class of a HTTP code

Awesome Lists containing this project

README

        

## httpclass

[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/ferhatelmas/httpclass)
[![Build Status](https://travis-ci.org/ferhatelmas/httpclass.png?branch=master)](https://travis-ci.org/ferhatelmas/httpclass)

> Returns the class of a HTTP status code.

### Install

```
go get github.com/ferhatelmas/httpclass
```

### Usage

```go
import "github.com/ferhatelmas/httpclass"

httpclass.Get(http.StatusOK)
//=> httpclass.Success, nil

httpclass.Get(http.StatusBadRequest)
//=> httpclass.ClientError, nil

httpclass.Get(0)
//=> Informational, "Wrong status code 0"
```

### License

MIT © [ferhat elmas](http://ferhatelmas.com)