Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gpod-request

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpod-request

Wouldn't it be nice to be able to use OPTIONS or DELETE methods in the browser?

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Get/Post/Options/Delete Request Mapper

Wouldn't it be nice to be able to use OPTIONS or DELETE methods in the browser?

This library lets you do this by treating URLs ending in the ! character as special cases.

  • GET /resource! becomes OPTIONS /resource, good for showing an edit form
  • POST /resource!! becomes DELETE /resource, good for deleting a resource

In all other cases, !! and ! get stripped from your path.

Dependencies

None

gpod-request

Get/Post/Options/Delete Request mapper

See: module:new-lib.default

module.exports ⏏

Kind: Exported class

new module.exports(req)

Map a Node request object to a generic GPOD request

ParamTypeDescription
reqHTTP.IncomingRequestThe Node request object

module.exports.url

Return the path and query part of this object combined

Kind: instance property of module.exports

module.exports.getBody() ⇒ string

Return the body as a string

Kind: instance method of module.exports

module.exports.getData() ⇒ URLSearchParams

Return the body as a SearchParams object

Kind: instance method of module.exports

module.exports.url(request) ⇒

Turn the request back to a GET/POST url

Kind: static method of module.exports
Returns: string

ParamType
requestRequest

FAQs

Package last updated on 01 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc