User registration through service I have a local Drupal instance with services. I created an endpoint that has user resource included. I verified that all is well by logging in using the endpoint. I am now stuck at registering new users through the api. I tried the following:

URL: http://localhost/recipes/api/user/register

Method: POST

Content-Type: application/json

Body: 
    {
   "name":"user34",
   "pass":"3323",
   "mail":"sample@example.com",
   "status":"1"
}

Result: 22:CSRF validation failed

I know that this error pops out when the token is not passed in the header of the request but how am I supposed to get the token if I am an anonymous user wanting to register?

Kindly mention the steps that I need to follow to have a user register through the REST api

Thanks :)
Anonymous (and authenticated) users can both get the token from the same place. Try following these steps:


Get the token with a GET to ?q=services/session/token
Attach the token to your POST header under the name X-CSRF-Token
Make the POST call to register the user