2

I installed Drupal 8 and these modules on my host:

  • HAL
  • HTTP Basic Authentication
  • RESTful Web Services
  • REST UI
  • Serialization

These are all core modules except REST UI.

According to Drupal tutorials (https://www.youtube.com/watch?v=4xCndQQVJsg and https://www.youtube.com/watch?v=DnZo5lMICKc) when I enter this URL, Drupal would show JSON format of node 1:

www.example.com/node/1?format=hal_json 

But it shows the normal (HTML) view of node 1.

What should I do to get JSON or hal+json format as output?

1
  • To improve your question, please provide a link to the modules you installed, and the tutorials you tried. Commented Jan 13, 2017 at 12:15

1 Answer 1

4

Send a GET to http://theurl.com/node/1?_format=hal+json

This should work! Make sure you enabled the Resources to read out nodes.

1
  • 1
    I think the string should be ?_format=hal_json Commented Aug 25, 2017 at 5:19

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.