Skip to content

rednafi/httpurr

Repository files navigation

ᗢ httpurr

>> HTTP status codes on speed dial <<

img

Installation

  • On MacOS, brew install:

     brew tap rednafi/httpurr https://github.com/rednafi/httpurr \
         && brew install httpurr
  • Or elsewhere, go install:

     go install github.com/rednafi/httpurr/cmd/httpurr
  • Else, download the appropriate binary for your CPU arch and add it to the $PATH.

Quickstart

  • List the HTTP status codes:

     httpurr --list
     ᗢ httpurr
     ==========
    
     Status Codes
     ------------
    
     ------------------ 1xx ------------------
    
     100    Continue
     101    Switching Protocols
     102    Processing
     103    Early Hints
    
     ------------------ 2xx ------------------
     ...
  • Filter the status codes by categories:

     httpurr --list --cat 2
     ᗢ httpurr
     ==========
    
     Status Codes
     ------------
    
     ------------------ 2xx ------------------
    
     200    OK
     201    Created
     202    Accepted
     203    Non-Authoritative Information
     204    No Content
     205    Reset Content
     206    Partial Content
     207    Multi-Status
     208    Already Reported
     226    IM Used
  • Display the description of a status code:

     httpurr --code 410
     ᗢ httpurr
     ==========
    
     Description
     -----------
    
     The HyperText Transfer Protocol (HTTP) 410 Gone client error response code
     indicates that access to the target resource is no longer available at the
     origin server and that this condition is likely to be permanent.
    
     If you don't know whether this condition is temporary or permanent, a 404 status
     code should be used instead.
    
     Status
     ------
    
     410 Gone
    
     Source
     ------
    
     https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410
  • See all available options:

     httpurr --help
     ᗢ httpurr
     ==========
    
     Usage of httpurr:
       --cat [category]
             Print HTTP status codes by category with --list;
             allowed categories are 1, 2, 3, 4, 5
       -c, --code [status code]
             Print the description of an HTTP status code
       -h, --help
             Print usage
       -l, --list
             Print HTTP status codes
       -v, --version
             Print version

Development

  • Clone the repo.
  • Go to the root directory and run:
     make init
  • Run the linter:
     make lint
  • Run the tests:
     make test
  • To publish a new version, create a new release with a tag, and the CI will take care of the rest.