KyleAMathews / superagent-bluebird-promise

Add promise support to superagent using Bluebird
MIT License
182 stars 37 forks source link

Problem with Changing the content-type #44

Open Gabxi opened 8 years ago

Gabxi commented 8 years ago

Hi,

I have this request

return superagent.post(url)
.send(request)
.set("Content-Type", "application/ocsp-request")
.then(function(res){
  return res;
}).catch(function(err) {
  return err;
});

I get an error saying

TypeError: first argument must be a string or Buffer

I played around with parts and it seems the problem is when I set the content-type. However, when I try to set other headers, it works fine. I was wondering if it's specific to content-type.

Thanks