Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

post rest drupal

curl --include 
  --request POST 
  --user klausi:secret 
  --header 'Content-type: application/hal+json' 
  --header 'X-CSRF-Token: <obtained from http://example.com/session/token> (Only needed if authenticating with a cookie rather than user credentials)' 
  http://example.com/entity/node?_format=hal_json 
  --data-binary '{"_links":{"type":{"href":"http://example.com/rest/type/node/article"}},"title":[{"value":"Example node title"}],"type":[{"target_id":"article"}]}'
Source by www.drupal.org #
 
PREVIOUS NEXT
Tagged: #post #rest #drupal
ADD COMMENT
Topic
Name
1+7 =