Content-Type: multipart/form-data; boundary=xxBOUNDARYxx


--xxBOUNDARYxx

Content-Type: application/json

Content-Disposition: form-data; name="Details"; 


{

"Name": "cust",

"FatherName": "Father Name",



"Type": "Flate",

"CNIC": "022543261544",

"Mobile": "03245432615",

"Phone": "0425432615",

"Address1": "Street 1 ",

"City": "Lahore" 

}

--xxBOUNDARYxx

Content-Disposition: form-data; name="PropertyDocImage"; 
filename="property_image.png"

Content-Type: image/png


{image file data bytes}

--xxBOUNDARYxx

Content-Disposition: form-data; name="CNICFrontImage"; 
filename="CNICFront_image.png"

Content-Type: image/png


{image file data bytes}

--xxBOUNDARYxx

Content-Disposition: form-data; name="CNICBackImage"; 

filename="CNICBack _image.png"

Content-Type: image/png


{image file data bytes}

--xxBOUNDARYxx

Content-Disposition: form-data; name="NeighborBillImage"; 
filename="NeighorBill_image.png"

Content-Type: image/png


I want to send images like above mentioned but it's not working for me.

Here I am trying to do
class ApplicationAPI(generics.GenericAPIView):
serializer_class = ApplicationSerializer
parser_classes = (JSONParser, MultiPartParser, FormParser)
def post(self, request):
serializer = self.get_serializer(data=request.data)
if serializer.is_valid(raise_exception=True):
application = serializer.save()
if application:
return Response({
"application": AppsSerializer(application, 
context=self.get_serializer_context()).data,
"status": 1,
"Message": "Success, continue to application setup",

})
return Response(
{
"status": 0,
"Message": "could not create record, try again."

}

)


Please help me in this 

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/c6f812b8-8e5e-4ebe-8c97-69b6debc862en%40googlegroups.com.

Reply via email to