kevinohara80 / nforce

nforce is a node.js salesforce REST API wrapper for force.com, database.com, and salesforce.com
MIT License
474 stars 167 forks source link

Request 2.48.0 causes UNSUPPORTED_MEDIA_TYPE when creating attachments #74

Closed jeffdonthemic closed 10 years ago

jeffdonthemic commented 10 years ago

Took me awhile to figure out that this issue was coming from an upgrade to Request.

If you run this code to create an attachment using Request 2.47 the attachment is created in salesforce successfully.

Using 2.48, it returns the following error from salesforce:

{ [Error: MediaType of 'multipart/related' is not supported by this resource]
  errorCode: 'UNSUPPORTED_MEDIA_TYPE',
  messageBody: 'MediaType of \'multipart/related\' is not supported by this resource',
  statusCode: 415 }
kevinohara80 commented 10 years ago

Hrm, I wonder what the change was. I'll take a look.

kevinohara80 commented 10 years ago

Looks like it was this commit.

https://github.com/request/request/commit/9669cd2ff897b155c485d7cfe42c431f964bac86

kevinohara80 commented 10 years ago

@jeffdonthemic I too get the error on v2.48. I'm running fine on v2.49. It looks like there was possibly a bug between v2.48 and v2.49. See this commit: https://github.com/request/request/commit/61e83725b892da2d57a2bd7b5a31fbd5519a2f20

I'm going to update the package.json and bump the min version of request to 2.49. Let me know if this resolves it for you.