Restful web services Documentation I am looking for complete and updated documentation for Restful web services.

For example, for the user login, we have to post the following data.

POST: http://example.com/user/login?_format=json
Content-type: application/json
Data: { "name": "admin", "pass": "myPassword" }
Response: 200 OK


This will properly log in via cookie authentication, and return a result similar to this.

    {
      "current_user": {
        "uid":"1",
        "roles":["authenticated"],
        "name":"admin"
      },
      "csrf_token":"abc123",
      "logout_token":"def456"
    }


How do I log out the user I just logged in with?

I found RESTful Web Services module overview, but I still don't understand how to log out.

Using the following request gets back a 403 Forbidden error.

POST: http://example.com/user/logout?_format=json
Content-type: application/json
Data: { "name": "admin" }


What am I missing?
As per documentation you can do like this.

Logout

GET http://example.com/user/logout
Content-type: text/html
200 - OK


Note: Do not pass "?_format=json" it is not accepting.