ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

Sending POST request resulting in "contentType.split is not a function" #1600

Open a2902793 opened 3 years ago

a2902793 commented 3 years ago

I have no issues with using get requests, but once I add in a post request, it spits out warning saying

 ...node_modules/superagent/lib/node/index.js:981
 if (contentType) contentType = contentType.split(';')[0];
                                                 ^

TypeError: contentType.split is not a function

which I find kinda strange since tracing back to index.js, other strings with split function like the ones used in parsing cookies worked ok, dunno if its a bug or did I missed something.