diff --git a/src/index.mjs b/src/index.mjs index 954399e..7a0bfe3 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -19,10 +19,10 @@ export default (a, options = {}, link = url.parse(a), body = "") => new Promise( if(options.method === "POST") { body = typeof options.body === "object" ? querystring.stringify(options.body) : options.body; delete options.body; - options.headers = {...options.headers, ...{ + options.headers = {...{ "Content-Type": "application/x-www-form-urlencoded", "Content-Length": Buffer.byteLength(body) - }}; + }, ...options.headers}; } (link.protocol === "https:"?https:http).request(options, res => resolve({ body: res,