I am totally new to AngularJs. I am trying to send a PATCH request using Angularjs to Django Tastypie API\'s. My code is
var module = angular.module(\'myAp
Your error doesn't make sense based on the code you're showing, but a common issue with adding PATCH
to AngularJS is that it doesn't have a default Content-Type header for that HTTP method (which is application/json;charset=utf-8
for PUT, POST and DELETE). Here's my configuration of the $httpProvider
to add patch support:
module.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.headers.patch = {
'Content-Type': 'application/json;charset=utf-8'
}
}])