Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 1. Install this plugin in wordpress:
# 2. Create wordpress user with username 'admin' and password 'admin'
# 3. Download an image and save it as 'google.jpg'
# 4. Upload image to wordpress REST API
curl \
-H "cache-control: no-cache" \
-H "Content-Type: image/jpg" \
-H 'Content-Disposition: attachment; filename=google.jpg' \
--data-binary "@$PWD/google.jpg" \
--user admin:admin
# 5. Create post with previously uploaded image as featured media
curl \
-H "Content-Type: application/json" \
-d '{"title":"My New Title", "content": "My content", "excerpt": "My excerpt", "status": "publish", "featured_media": 1}' \
--user admin:admin \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.