When using the RESTAdapter with Express.js, server returning 400 error "invalid json" #1615

lsdafjklsd opened this Issue Dec 22, 2012 · 5 comments


None yet

3 participants


I'm not sure if this problem is on Express's end or here, but for some reason the default hash.contentType = 'application/json; charset=utf-8'; under the RESTAdapters ajax function causes express to return the 400 error Error: invalid json.

Modifying the default content type to
hash.contentType = 'application/x-www-form-urlencoded; charset=utf-8';
fixes the issue.

Ember.js member

Is this for GET requests?

Ember.js member

This should be filed on https://github.com/emberjs/data/issues.

@wagenet wagenet closed this Dec 22, 2012

@trek Yea, was getting it on App.User.find().

Also, I totally meant to to submit this to the ember-data project.

Ember.js member

I'm pretty sure it's this issue: emberjs/data#402


@wagenet That's it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment