I have this Javascript (jQuery) code:
$.ajax({
url: `/rest/order`,
type: 'DELETE',
data: { "magentoid": order_id },
success: function(data) {
},
error: function(xhr, status, error) {
}
});
And when checking this call in the Chrome developer console, I can see the body is sent as well:
However, in my CherryPy implementation, that data seems to be completely ignored:
@cherrypy.expose
@cherrypy.tools.json_out()
def order(self, supplier = None, magentoid = None, dropship = None):
logging.info(f"supplier: {supplier}, magid: {magentoid}")
results in:
INFO:root:supplier: None, magid: None
When I make the call in Javascript with $.post, it does work:
$.post(
"/rest/order",
{ "magentoid": orderid, "dropship": $("#dropship").is(":checked") },
function(data) {
}
).fail(function() {
});
and this shows in my CherryPy log:
INFO:root:supplier: None, magid: M13000000063
Update, also when I change DELETE into POST in the $.ajax call, the data goes away.
