Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Problems with non-json data. #1

Closed
ballPointPenguin opened this issue Sep 2, 2015 · 3 comments
Closed

Problems with non-json data. #1

ballPointPenguin opened this issue Sep 2, 2015 · 3 comments

Comments

@ballPointPenguin
Copy link

I was attempting to use ember-json for a POST with FormData (Content-Type:multipart/form-data) for a file upload operation. Unfortunately, ember-ajax overrides the contentType and also passes the data through JSON.stringify.

https://github.com/ember-cli/ember-ajax/blob/master/addon/services/ajax.js#L132

Perhaps there can be an option to disable this feature or maybe disable it automatically if options.dataType or options.contentType are set to something other than json.

If not, then the documentation should clearly state that this service is designed ONLY for json data.

@taras
Copy link
Contributor

taras commented Sep 2, 2015

I agree that ember-ajax should not enforce payload to be in JSON format. I rarely work with non JSON data, so I don't have much personal experience with that uses case. I would like to take some time on deciding how to add this to the library(PRs are welcome, as I see you've done already in #2 ).

@abuiles
Copy link
Member

abuiles commented Sep 30, 2015

This is fixed by #5

@abuiles abuiles closed this as completed Sep 30, 2015
@ballPointPenguin
Copy link
Author

thanks, @abuiles

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

No branches or pull requests

3 participants