[Fixed]-How do I post to Django using Axios?


request.POST is only for form-encoded data. If you are posting JSON, then you should use request.body instead.

import json

If you do this, you’ll have to make changes to your class based view to use request.body instead.

If you want to get axios to send form encoded data instead, this issue on GitHub might help.

Leave a comment