Following is my code:
$http({
url: 'https://apistage.dealsignal.com/api/v0/company_watchlists/' + wishlist_id,
method: 'PATCH',
params: {
list: {
add_company_ids: ['61737'],
name: 'My Wishlist'
},
api_key: 'CtxY3Kpc7ZDL8VDfLmPt9wss'
}
})
.success(function(response) {
console.log(response);
}).
error(function(response) {
console.log(response);
return false;
});
I am getting bad request error but same request with patch method is working in REST CLIENT on chrome.
Please see the Angular Doc. This will be Data not params.
$http({
url: 'https://apistage.dealsignal.com/api/v0/company_watchlists/' + wishlist_id,
method: 'PATCH',
data: {
list: {
add_company_ids: ['61737'],
name: 'My Wishlist'
},
api_key: 'CtxY3Kpc7ZDL8VDfLmPt9wss'
}
}).success(function(response) {
console.log(response);
}).
error(function(response) {
console.log(response);
return false;
});
I am not sure about it, but may be the problem is that the parameter "params" should be named "data", as when you make a POST request.
Hope it helps.
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