Skip to content

nherment/node-request-arguments-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parses a HTTP request argument, regardless of whether it is a GET, POST form, JSON or route parameter.

Currently only work with express requests.

If an argument key is on passed multiple times (ie: GET /api/?service=) only one is return. The following hierarchy is respected (the first encounter wins)

  1. route ==> /api/:variable
  2. body ==> {"variable": [..]}
  3. get param ==> /api?variable=[..]

You have to prepare the request with the connect.bodyParser, json or/and urlencoding middleware.

About

retrieve express request arguments whether they are in GET, POST or JSON body params

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published