Question : post rest drupal
Answered by : charming-capybara-s5u8t1gif49w
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 : https://www.drupal.org/docs/8/core/modules/rest/3-post-for-creating-content-entities | Last Update : Fri, 29 Apr 22