Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipart support doesnt seem to work #58

Open
jnankin opened this issue Jul 6, 2015 · 0 comments
Open

multipart support doesnt seem to work #58

jnankin opened this issue Jul 6, 2015 · 0 comments

Comments

@jnankin
Copy link

jnankin commented Jul 6, 2015

Say I have this code:

var request = unirest.post(endpoint);
request.part({
'Content-Disposition': 'file; filename="inflation.tiff"',
'content-type': 'image/tiff',
'Content-Transfer-Encoding' : 'base64',
body: base64Image
});

Couple of things:

  1. index.js looks for "content-type" which is case sensitive.
  2. This code errors out with:
    /home/jnankin/node_modules/unirest/index.js:321
    $this.options.multipart.push(options);
    ^
    TypeError: Cannot call method 'push' of undefined

Looking at index.js, I don't see where $this.options.multipart would ever have been set. It's only set if !$this._multipart, but _multipart is definied by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant