SERVICES - 406 Not Acceptable; 401 Unauthorized

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
samuraijack's picture

Hello,

Have anyone worked on the SERVICES module?
This module works properlly but I can`t login on it.

I check connection in Firefox due to "Poster" tools and "HttpRequester" tool. I used link http://10.10.30.100/mk/?q=drupalgap/user/login.json in
"Content Type": application/x-www-form-urlencoded

For Drupal 6:406 Not Acceptable

Drupal 7: 401 Unauthorized: Missing required argument username

I gave for user "anonymous user" i "authenticated user" all possible permissions

Comments

You need to add under

yves_s's picture

You need to add under "Parameters"
Name: username Value: the users name --> Add/Change
Name: password Value: the users password --> Add/Change

Then back to "Content to Send" and press "Body from Parameters".

After these steps should appear in "Content Type"
application/x-www-form-urlencoded

and in the box under "Content Options:" like:
username=the_users_name&password=the_users_password

This works for me! Thanks! :)

sneha_surve's picture

This works for me!
Thanks! :)

This works for me! Thanks! :)

sneha_surve's picture

This works for me!
Thanks! :)

Thanks for your help. Now I

samuraijack's picture

Thanks for your help. Now I understand where you made ​​a mistake

I have the same error but...

EMariano's picture

I have the same error, but not in Poster. In poster everything's works perfectly but when i tried to use the Rest Auth Module to login i had the 401 Unauthorized: Missing required argument username.

I have same code 401

dongtian's picture

Missing required argument name

Getting same error

charubachi's picture

Hi I am getting the same error. I am using Postman plugin. If I try to send data in POST method through services through 'x-www-form-urlencoded ' then I am able to see the output but when I use RAW json values. with or without header Content type = application/json then I receive 401 Unauthorized error with 406 Not Acceptable. Is there any solution?

X-CSRF-Token needed for each request

dickshelly's picture

first you need to call ?q=services/session/token
maintain whatever you are getting
and send it as header "X-CSRF-Token" for all further requests

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: