Is it possible to use a custom HTTP VERB, like MERGE, with jQuery.ajax()? I'm interacting with an OData API, which expects a MERGE verb when posting updates to records.
The problem I'm having is that when I use "MERGE" in the ajax() request, it doesn't send data to the server. It just sends a MERGE request with no data, so the OData service rejects it.
When I change the request to a PUT, the OData service sends back a 500 error.
My options are basically to figure out how to get "MERGE" calls to send the data along with the request, do a DELETE followed by a POST (delete and recreate the record on every update), or figure out how to modify the OData service to accept PUTs for updates.
Let me know if you have any ideas on how to make jQuery.ajax() send the data with a MERGE request.
Thanks,
Dave
This is not a question of jQuery
's ability to handle custom HTTP verbs, this depends on the browser.
OData supports tunneling MERGE through POST - which of course is supported via JQuery - by adding the X-HTTP-Method header.
See this thread for more
Alex
OData Program Manager Microsoft
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With