Skip to content

Instantly share code, notes, and snippets.

@virtimus
Last active December 16, 2018 11:29
Show Gist options
  • Save virtimus/6839762236abffc5cd4c5703db608829 to your computer and use it in GitHub Desktop.
Save virtimus/6839762236abffc5cd4c5703db608829 to your computer and use it in GitHub Desktop.
Accessing Wordpress REST API using OpenApi swager-editor
  • first upload binary:
curl -k -X POST "https://[host]/wp-json/wp/v2/media" -H  authorization: Basic [authKey]" -H "Content-Disposition: form-data; filename=\"b2.png\"" -H  "Content-Type: application/x-www-form-urlencoded" --data-binary "@/[path]/b2.png"
  • get id from response and update meta using swagger-editor or curl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment