I have a Drupal 8 website. I need to access the list of articles using www.myexample.com/rest/views/articles.
I could get the token using curl --header "Content-type: application/json" -b cookies.tt --request POST "https://www.myexample.com/user/login?_format=json" --data '{"name":"myname", "pass":"mypassword"}'
.
How do I use cUrl to pass the token or user/pass and get 'rest/views/articles' in JSON format?
I tried curl --header 'authorization: Bearer {D12G7AajU9NdUAb260zqwCimfdddR1Krg5}' --url https://www.myexample/rest/views/artigos/format?_format=json
,
but it returns an error.
UPDATE
I follow the @Ismail Cherri suggestion, seems a progress in the question but give me back :
"message":"The used authentication method is not allowed on this route."
In drupal website the config :
/entity/view/{view} is set to :
GET
formats: hal_json, json
authentication: basic_auth
and /entity/entity_view_mode/{entity_view_mode} is set to :
GET
formats: hal_json, json
authentication: basic_auth
anyone could help?