I am calling Image upload Api(Django rest api) from my view in seperate django project
my View
if request.method == 'POST' and request.FILES['file']:
try:
resp = requests.post(
"http://19.******/BankImage_API",
files = {"file" :request.FILES['file']},
headers={"content-type": "multipart/form-data",
"Authorization": "Token 71117971*************"
}, verify=False)
Api
class Bankimageapi(APIView):
def post(self, request):
if request.method == 'POST' and request.FILES['file']:
try:
........
when I tried to Upload Image.
i get error in api where FILES <MultiValueDict: {}>.
django.utils.datastructures.MultiValueDictKeyError: 'file' Please guide me solve this problem .