Open eddypjr opened 2 years ago
When can-ajax is used with the PATCH method, the body payload should append to the request body, not the url query string.
can-ajax
PATCH
POST
PUT
ajax({ url: ``${loader.serviceBaseURL}/carrito_articulo?${pk.toString()}``, type: 'PATCH', data: {foo: 'bar'} })
I think we have to change line 221
from
var isPost = type === "POST" || type === "PUT"
to
var isPost = type === "POST" || type === "PUT" || type === "PATCH"
I tried it locally and works as expected.
When
can-ajax
is used with thePATCH
method, the body payload should append to the request body, not the url query string.POST
andPUT
are working as expected, but sending a JSON payload withPATCH
is not.ajax({ url: ``${loader.serviceBaseURL}/carrito_articulo?${pk.toString()}``, type: 'PATCH', data: {foo: 'bar'} })