Media type when sending content to server
Closed this issue · 2 comments
retog commented
The content-type should be set to application/ld+json rather than application/json.
bergie commented
You can pass regular jQuery AJAX options to the saveRemote method in Create:
https://github.com/bergie/create/blob/master/src/jquery.Midgard.midgardStorage.js#L271
This means that you should be able to change the media type by option like:
{
"contentType": "application/ld+json"
}
Here is an example of AutoSave doing something related: https://github.com/bergie/create/blob/master/src/jquery.Midgard.midgardStorage.js#L75
retog commented
Ok, so you want to keep application/json as it can be override with this options.
I couldn’t find out where to pass this options. My html looks pretty much like example.html.