Powershell curl.exe: POST request gets "400 bad request unexpected token in JSON at position..."

Viewed 10

So I just want to make a curl (curl.exe not the basic curl on Powershell) and I'm getting this error on Powershell (Windows 10):

{"statusCode":400,"error":"Bad Request","message":"Unexpected token u in JSON at position 2"}

This is my command:

curl.exe -X POST -H "Content-Type: application/json" -d '{ "username": "Code", "password": "Witcher" }' http://localhost:3000/login

This works on a git bash console as it is. How do you convert this to be used in a Powershell console?

0 Answers
Related