当采用客户端象django的服务器提交post请求时。会得到403,权限异常。
解决办法:
导入模块
from django.views.decorators.csrf import csrf_exempt
在函数前面添加修饰器
@csrf_exempt
# Create your views here.
@csrf_exempt
def index(request):
if request.method == 'POST':
body = json.loads(request.body)
print body['value']
return HttpResponse(request.body)