课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Understanding HTTP request methods
课程: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Understanding HTTP request methods
- We're ready to send this proposed new name data to the server and persist it in MongoDB. We'll need to add a new endpoint to our API. We'll need to add it for both the router and the client. Let's start with the router. So we have "get" slash contests to give us a list of contests. We have "get" slash contest slash contest ID to give us the information for a single contest. And what we need now is another endpoint but this time we'll have to use either "post" or "put" not "get". We usually use "post" for creating a new entity in the database and we use "put" for updating an entity in the database. The one that we're doing here is a bit of both because we're really creating a new name but it's also updating the contest because our MongoDB structure is a single contest with nested documents. So I'll use "post." It doesn't matter if you use "post" or "put" they're kind of similar but you definitely cannot use "get"…
内容
-
-
-
-
-
-
-
(已锁定)
Handling data in an array3 分钟 27 秒
-
(已锁定)
Reading form data with the DOM API6 分钟 49 秒
-
(已锁定)
Understanding HTTP request methods2 分钟 19 秒
-
(已锁定)
Using an API endpoint to update data9 分钟 48 秒
-
(已锁定)
Updating UI based on API response1 分钟
-
(已锁定)
Project challenge2 分钟 1 秒
-
(已锁定)
Next steps1 分钟 27 秒
-
(已锁定)