Skip to content

Instantly share code, notes, and snippets.

@saltednut
Created August 6, 2015 19:43
Show Gist options
  • Save saltednut/0341b38d36c6781ae3f5 to your computer and use it in GitHub Desktop.
Save saltednut/0341b38d36c6781ae3f5 to your computer and use it in GitHub Desktop.
D7 Restws v D8 Rest - node status change
# Drupal 8 (Enabled modules: rest, hal, basic_auth, serialization)
curl -vX PATCH --user admin:pass http://site.dd/node/1 --header "Content-Type: application/hal+json" -d'{"_links":{"type":{"href":"http://site.dd/rest/type/node/article"}}, "status":[{"value":"0"}]}’
# Drupal 7 (Enabled modules: restws, restws_basic_auth)
drush vset restws_basic_auth_user_regex '/.*/'
curl -vX PUT --user admin:pass http://site.dd/node/1 --header "Content-Type: application/json" -d'{"status":"0"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment