Giter Site home page Giter Site logo

blackglory / http-status Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 660 KB

๐ŸŒฒ A class-based HTTP status library.

Home Page: https://www.npmjs.com/package/@blackglory/http-status

License: MIT License

JavaScript 4.09% TypeScript 95.91%
npm-package library browser nodejs typescript esm

http-status's Introduction

http-status

A class-based HTTP status library.

Install

npm install --save @blackglory/http-status
# or
yarn add @blackglory/http-status

API

fromCode

function fromCode(code: number): HTTPStatus

When the status code is unknown, it will throw UnkonwnHTTPStatusError.

HTTPStatus

interface HTTPStatus {
  code: number
  message: string
}
Code HTTPStatus
1xx HTTPInformational
100 Continue
101 SwitchingProtocol
102 Processing
103 EarlyHints
2xx HTTPSuccessful
200 OK
201 Created
202 Accepted
203 NonAuthoritativeInformation
204 NoContent
205 ResetContent
206 PartialContent
207 MultiStatus
208 AlreadyReported
226 IMUsed
3xx HTTPRedirection
300 MultipleChoice
301 MovedPermanently
302 Found
303 SeeOther
304 NotModified
307 TemporaryRedirect
308 PermanentRedirect
4xx HTTPClientError
400 BadRequest
401 Unauthorized
403 Forbidden
404 NotFound
405 MethodNotAllowed
406 NotAcceptable
407 ProxyAuthenticationRequired
408 RequestTimeout
409 Conflict
410 Gone
411 LengthRequired
412 PreconditionFailed
413 PayloadTooLarge
414 URITooLong
415 UnsupportedMediaType
416 RangeNotSatisfiable
417 ExpectationFailed
421 MisdirectedRequest
422 UnprocessableEntity
423 Locked
424 FailedDependency
426 UpgradeRequired
428 PreconditionRequired
429 TooManyRequests
431 RequestHeaderFieldsTooLarge
451 UnavailableForLegalReasons
5xx HTTPServerError
500 InternalServerError
501 NotImplemented
502 BadGateway
503 ServiceUnavailable
504 GatewayTimeout
505 HTTPVersionNotSupported
506 VariantAlsoNegotiates
507 InsufficientStorage
508 LoopDetected
510 NotExtended
511 NetworkAuthenticationRequired

http-status's People

Contributors

blackglory avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.