【发布时间】:2017-03-07 13:46:05
【问题描述】:
我正在尝试为一种内容类型创建多个节点 PATCH。目前我只能修补一个节点:
curl --include \
--request PATCH --user username:password \
--header 'Content-type: application/hal+json' \
--header 'X-CSRF-Token: <obtained from http://my_website.com/rest/session/token>' \
http://my_website.com/node/1862?format=hal_json \
--data-binary '{"_links":{"type":{"href":"http://my_website/rest/type/node/faq"}},"title":[{"value":"Example node title UPDATED!"}],"type":[{"target_id":"faq"}]}'
我想从其他 GET 更新所有“常见问题”内容类型节点,我可以在 http://my_other_website_which_is_my_source.com/api/rest/all_faq_nodes 上生成这些节点
是否可以将 GET 结果添加到 --data-binary? 不幸的是,我试图在 Drupal 网站上获取更多信息,但没有成功。
Drupal 版本:8.2.1
干杯!
【问题讨论】:
-
请注意,PATCH 是根据定义而不是 RESTful
标签: json rest curl drupal patch