[Fixed]-Django JWT Auth, why one request works and the other not

1👍

Curl’s -d option actually sends the request like it’s a web browser. My guess is that the URL you’re testing against doesn’t have a standard web form, so it can’t actually process the request.

TL;DR Pretty sure Django JWT Auth doesn’t support the application/x-www-form-urlencoded content type.

From curl manual:

-d –data
(HTTP) Sends the specified data in a POST request to the HTTP
server, in the same way that a browser does when a user has
filled in an HTML form and presses the submit button. This will
cause curl to pass the data to the server using the content-type
application/x-www-form-urlencoded. Compare to -F, –form.

Hope this helps!

Leave a comment