Skip to content
Advertisement

POST object via Form-Data ( in Django)

Trying to post the data via multipart (form data) in django backend from react js.

JavaScript

but in Django it interprets the cityName like this [‘[object Object]’]

Am I doing something wrong ?

Advertisement

Answer

You probably should use JSON.stringify on doc as follows

JavaScript

Afterwards in your django view you need to parse the data

JavaScript

example using class based views

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement