Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 708 Bytes

README.md

File metadata and controls

24 lines (22 loc) · 708 Bytes

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