当我尝试生成令牌时,我会丢失授权类型错误。即使我在有效负载中传递授权类型
@csrf_exempt
@api_view(['POST'])
def merchanttokengeneration(request):
payload = request.data
token = request.META.get('HTTP_TOKEN')
headers = {"token": token, "Content-Type":"application/json"}
print(headers)
response = requests.request("POST",'https://staging/merchant/v1/oauth/token', data=json.dumps(payload),headers=headers, auth=HTTPBasicAuth(payload.get('username'), payload.get('password') ))
print(response)
return HttpResponse(response)