GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - torokmark/response_code: Response Code in readable way.

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
features
features
 
 
lib
lib
 
 
.gitignore
.gitignore
 
 
.ruby-version
.ruby-version
 
 
.travis.yml
.travis.yml
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
response_code.gemspec
response_code.gemspec
 
 

Repository files navigation

ResponseCode

Build Status Gem Version

Who knows which response code represents the partial content? Or what code belongs to the error that says the request uri too long? Do you know the status code of the teapot?

ResponseCode is a tiny tool intended to give a handy way of handling response status codes with text instead of numbers.

Install

gem install response_code

or

gem 'response_code'

Usage

require 'response_code'

puts ResponseCode.ok
# => 200

Using sinatra

#!/usr/bin/env ruby 

require 'sinatra'
require 'response_code'

get('/') {
  status ResponseCode.im_a_teapot
  'I\'m a teapot!' 
}

Executing curl -i localhost:4567

HTTP/1.1 418  
Content-Type: text/html;charset=utf-8
Content-Length: 13
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Server: WEBrick/1.4.2 (Ruby/2.5.0/2017-12-25)
Date: Thu, 03 May 2018 18:24:12 GMT
Connection: Keep-Alive

I'm a teapot!

About

Response Code in readable way.

Topics

httpresponse-codestatus-codes

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.