[Poly > Request] Replace deprecated querystring with URLSearchParams
This commit is contained in:
parent
a0569aeeb0
commit
6fa918c6c7
1 changed files with 1 additions and 2 deletions
|
@ -1,9 +1,8 @@
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
const querystring = require("querystring");
|
|
||||||
|
|
||||||
// Generic polyfill for "request" npm package, wrapper for https
|
// Generic polyfill for "request" npm package, wrapper for https
|
||||||
const nodeReq = ({ method, url, headers, qs, timeout, body, stream }) => new Promise((resolve) => {
|
const nodeReq = ({ method, url, headers, qs, timeout, body, stream }) => new Promise((resolve) => {
|
||||||
const fullUrl = `${url}${qs != null ? `?${querystring.stringify(qs)}` : ''}`; // With query string
|
const fullUrl = `${url}${qs != null ? `?${(new URLSearchParams(qs)).toString()}` : ''}`; // With query string
|
||||||
|
|
||||||
let req;
|
let req;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue