Skip to content

SyysBiir/json-to-http-query-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

JSON to HTTP Query string

npm

This package allows you to convert JSON to Http query string

Getting Started

To install the module, run the following in the command line:

npm i json-to-http-query-string --save

Use within your application with the following line of JavaScript:

const jsonToQuery = require('json-to-http-query-string');
//or 
//import jsonToQuery from 'json-to-http-query-string'

jsonToQuery({
  foo: "hi",
  bar: {
    blah: [1, 2, 3],
    blah2: 123
  }
}) 
//foo=hi&bar%5Bblah%5D%5B0%5D=1&bar%5Bblah%5D%5B1%5D=2&bar%5Bblah%5D%5B2%5D=3&bar%5Bblah2%5D=123