Coder Social home page Coder Social logo

olamide-1234 / http-request-method-db Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pichillilorenzo/http-request-method-db

0.0 0.0 0.0 75 KB

HTTP Request Method Database

Home Page: https://pichillilorenzo.github.io/http-request-method-db/

License: ISC License

TypeScript 100.00%

http-request-method-db's Introduction

HTTP Request Method Database

NPM

NPM Version license Donate to this project using Paypal

This is a database of known HTTP Request Methods and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:

Installation

npm i --save http-request-method-db

Database Download

If you want download the database and use it directly in the browser, you can just grab the JSON file using jsDelivr. It is recommended to replace main with a release tag as the JSON format may change in the future.

https://cdn.jsdelivr.net/gh/pichillilorenzo/http-request-method-db@main/dist/db.json

Usage

import db from 'http-request-method-db';
// .. or
const db = require('http-request-method-db').default;

const getInfo = db['get']; // An instance of HTTPRequestMethod
console.log(getInfo.syntax); // GET /index.html

Access HTTP Request Method info using the request method name in lower case as key.

Contributing

The primary way to contribute to this database is by updating the data in one of the upstream sources. Check the scripts/src/mdn-scraper.ts to check the MDN scraper implementation.

Direct Inclusion

If that is not possible / feasible, they can be added directly here as a "custom" request method.

To edit the database, only make PRs against scripts/src/custom-request-methods.json.

The scripts/src/custom-request-methods.json file is a JSON object of type HTTPRequestMethodDb, where each key is the request method name in lower case and the value is an Object of type HTTPRequestMethod.

To update the build, run npm run build:all.

HTTPRequestMethodDb Data Structure Example

{
  "connect": {...},
  "get": {
    "name": "GET",
    "description": "The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data). Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
    "note": "Note: Sending body/payload in a GET request may cause some existing implementations to reject the request — while not prohibited by the specification, the semantics are undefined. It is better to just avoid sending payloads in GET requests.",
    "syntax": "GET /index.html",
    "link": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET",
    "requestHasBody": false,
    "successfulResponseHasBody": true,
    "safe": true,
    "idempotent": true,
    "cacheable": true,
    "examples": [],
    "specifications": [
      {
        "name": "HTTP Semantics # GET",
        "link": "https://httpwg.org/specs/rfc9110.html#GET"
      }
    ],
    "browserCompatibility": [
      {
        "name": "Chrome",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Edge",
        "supported": true,
        "version": "12"
      },
      {
        "name": "Firefox",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Opera",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Safari",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Chrome Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Firefox for Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Opera Android",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Safari on iOS",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "Samsung Internet",
        "supported": true,
        "version": "Yes"
      },
      {
        "name": "WebView Android",
        "supported": true,
        "version": "Yes"
      }
    ]
  },
  "head": {...},
  ...
}

Check HTTPRequestMethodDb for more details.

License

Released under the ISC license.

This project is strongly inspired by the mime-db.

http-request-method-db's People

Contributors

pichillilorenzo avatar olamide-1234 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.