I have a simple form with three fields. I need to submit it with Ajax (to a service that returns JSON) but I get 415 Unsupported Media Type. The form works just fine when it does not use Ajax. The POST comes out like this:
name=Michael&email=mla%40enonic.com&message=test
but shouldn’t it look like this:
{name: ‘Michael’, email: ‘mla@enonic.com’, message: ‘test’} ?
The service exports.post does not run.
There is no clue in the log that there was any problem, but the response in Firebug has this: Could not find message body reader for type: class javax.ws.rs.core.Form of content type: application/json;charset=UTF-8 (javax.ws.rs.NotSupportedException)
I think there is a missing RESTEasy jar file “resteasy-multipart-provider.jar” see here http://www.mkyong.com/webservices/jax-rs/resteasy-could-not-find-message-body-reader-for-type-multipartform-data/