Last active
September 3, 2016 17:57
-
-
Save alex-moreno/d61cf059b16cd00d5c536addb45c1895 to your computer and use it in GitHub Desktop.
Create a new content in Drupal via rest api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --include --request POST --user user:pass --header 'Content-type: application/hal+json' --header 'X-CSRF-Token: <obtained from http://example.com/rest/session/token>' http://local.drupal8.com/entity/node?_format=hal_json --data-binary '{"_links":{"type":{"href":"http://local.drupal8.com/rest/type/node/cruise"}},"title":[{"value":"Example node title"}],"type":[{"target_id":"article"}]}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --include --request POST --user user:pass --header 'Content-type: application/hal+json' --header 'X-CSRF-Token: <obtained from http://example.com/rest/session/token>' http://local.drupal8.com/entity/node?_format=hal_json --data-binary '{"_links":{"type":{"href":"http://local.drupal8.com/rest/type/node/cruise"}},"title":[{"value":"Mediterranean cruise adventure"}],"type":[{"target_id":"cruise"}]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment