Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: wretch
node v8.17.0
endpoint
share
tweet
var wretch = require("wretch") var { URLSearchParams } = require('url') const urlParams = new URLSearchParams() urlParams.append('a', 1) urlParams.append('a', 2) console.log( 'Standard URLSearchParams: ' + urlParams.toString() ) const obj = { a: [1, 2] } wretch().polyfills({ URLSearchParams }) console.log( 'Wretch with the standard URLSearchParams: ' + wretch('/').query(obj)._url ) console.log( 'Wretch using your own custom string: ' + wretch('/').query('a=[1,2]')._url )
Created from: https://npm.runkit.com/wretch
Loading…
Clone and edit this document