Login using REST request gives 404 This is so simple login request but cannot figure out why I am getting such error message when trying to login using Postman.

I use url http://localhost:8080/user/login?_format=json and input in the header Content-Type:application/json and I have in my body {"name":"user", "pass":"pass"} but I am getting this error message


  {     "message": "The \"user\" parameter was not converted for the path
  \"/user/{user}\" (route name: \"rest.entity.user.GET\")" }


Using curl works though:

curl --header "Content-type: application/json" --request POST --data '{"name":"admin", "pass":"pass"}' http://localhost:8080/user/login?_format=json


curl result:


  {"current_user":{"uid":"1","roles":["authenticated","administrator"],"name":"admin"},"csrf_token":"XXXXX","logout_token":"XXXXX"}
I have faced the same issue and resolved it by selecting "POST" method from dropdown list.

Find the below image:-


OUTPUT:-
{
    "current_user": {
        "uid": "1",
        "roles": [
            "authenticated",
            "administrator"
        ],
        "name": "admin"
    },
    "csrf_token": "XXXXXXXXXXXX",
    "logout_token": "XXXXXXXXXXX"
}

Note: we can get this output for the first time, if we try for the second time we will get message like 


  {
      "message": "This route can only be accessed by anonymous users." }


because postman works as a browser. 
To get it work for the second time we need to remove the cookie from postman.

Kindly let me know if I am wrong.
Thanks..