This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Fix #104: Add support for the attachment API. #115
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yes, it is combination of isomorphic-fetch and jsdom FormData I guess. In the examples given on // post with form-data (detect multipart)
var FormData = require('form-data');
var form = new FormData();
form.append('a', 1);
fetch('http://httpbin.org/post', { method: 'POST', body: form })
.then(function(res) {
return res.json();
}).then(function(json) {
console.log(json);
}); I pushed a very dirty commit on the branch with some code that works... let's say it's step 1, but it introduces some ugly dependencies to |
leplatrem
force-pushed
the
104-attachment-api-support
branch
from
July 14, 2016 12:34
ab51388
to
2a02003
Compare
Made something slightly better... |
* @param {Object} [options.permissions] The permissions option. | ||
* @return {Promise<Object, Error>} | ||
*/ | ||
addAttachment(dataURI, record={}, options={}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: add @capable
decorator
n1k0
force-pushed
the
104-attachment-api-support
branch
from
July 18, 2016 16:47
3dcce8f
to
845a5e4
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WiP, refs #104, cc @leplatrem.
I'm stuck here with this kinto server error Kinto/kinto-attachment#100
It's certainly a problem with the patch implementation as attaching a file using httpie and the kinto admin both work just fine. It may be related to jsdom's
FormData
implementation.I'd be happy to get some help here.