Alamofire invalid value around character 0 Alamofire invalid value around character 0 ios ios

Alamofire invalid value around character 0


I also faced same issue. I tried responseString instead of responseJSON and it worked. I guess this is a bug in Alamofire with using it with django.


In my case , my server URL was incorrect. Check your server URL !!


I got same error while uploading image in multipart form in Alamofire as i was using

multipartFormData.appendBodyPart(data: image1Data, name: "file")

i fixed by replacing by

multipartFormData.appendBodyPart(data: image1Data, name: "file", fileName: "myImage.png", mimeType: "image/png")

Hope this help someone.