Join Morten Rand-Hendriksen for an in-depth discussion in this video POST, part of Learning REST APIs.
- Given the necessary authorization,…a REST API can be used to create new resources.…And in the case of WordPress, that means we can use…the REST API to create new posts.…This is typically done by sending…a POST request to a resource collection,…like the posts collection inside of WordPress.…To create a new post via the REST API,…I want to send a POST request to…this posts resource up here, so the first thing…I'll do is set up a POST request.…Then I need to add an authorization header…to show I actually have the ability to use the POST method.…
I'm sending data along with my POST request,…so that means I need to find what type of data this is.…I do that with a Content-Type header,…and here I want to set up application and JSON…because this will be JSON data.…And then finally, I need to encode the actual data…for the post in JSON so that gets sent along.…It looks like this.…For WordPress, I only really need three things:…I need a title,…some content,…and finally, a status.…
Now technically I don't need the status,…
- What is a REST API?
- Who or what interacts with REST APIs?
- Anatomy of a REST request
- HTTP status messages
- Request/response pairs
- GET, POST, and DELETE
Skill Level Beginner
HTTP Essential Trainingwith Morten Rand-Hendriksen50m 18s Beginner
1. REST API: Representational State Transfer Application Programming Interface
4. Request/Response Pairs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.