I am having problem sending PUT and DELETE REST API from my front end to my ZF2 backend. However: I am able to send POST and GET request and it's working fine but not PUT and DELETE won't. Why?
Below is my ajax code:
$.ajax({
type: "PUT",
dataType: "json",
data: data,
url: "/backend/api/product",
statusCode: {
200: function (data) {
product= data.content;
}
}, error: function (data) {
alert(data.responseJSON.message);
}
});
The error that I get from my ZF2 are:
Zend\View\Renderer\PhpRenderer::render: Unable to render template "api/product/replace-list"; resolver could not resolve to a file
api/product/replace-listwhich I feel is unrelated to the question you're asking. Please show what your controller action looks like and possibly yourview_managerconfig.