I am using authentication.py for oauth2 with tastypie.
Get method is working fine but POST I am getting 401 status code.
The access token is correct with read-write permission.
class ExampleResource(ModelResource):
class Meta:
queryset = ExampleModel.objects.all()
resource_name = 'example'
detail_allowed_methods = ['post',]
authorization = DjangoAuthorization()
authentication = OAuth20Authentication()
always_return_data = True
default_format = "application/json"
API url : http://localdisk:8000/api/v1/example/
I am sending Access token in header of packet.
It is working fine when authorization = Authorization() is used in place of DjangoAuthorization()
Can anyone please give info where it is wrong ? Thanks in advance.