Skip to content

Commit

Permalink
fix: show PUT example, not POST
Browse files Browse the repository at this point in the history
  • Loading branch information
kennedymwavu committed Apr 2, 2024
1 parent 3a500b8 commit 8f7ee96
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 03_basic_routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ app$post("/", \(req, res) {
Respond to a PUT request to the `/user` route:

```r
app$post("/user", \(req, res) {
app$put("/user", \(req, res) {
res$send("Got a PUT request at /user")
})
```
Expand All @@ -58,6 +58,6 @@ app$delete("/user", \(req, res) {
Here is how issuing the various requests above would look like:
![GET request to /](./get-home.png)
![POST request to /](./post-home.png)
![POST request to /user](./post-user.png)
![POST request to /user](./put-user.png)
![DELETE request to /user](./delete-user.png)
- Open another R session and use [httr2](https://httr2.r-lib.org/index.html) to make requests to the endpoints.
2 changes: 1 addition & 1 deletion 03_basic_routing/index.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ app$post("/", \(req, res) {
res$send("Got a POST request")
})

app$post("/user", \(req, res) {
app$put("/user", \(req, res) {
res$send("Got a PUT request at /user")
})

Expand Down
Binary file removed 03_basic_routing/post-user.png
Binary file not shown.
Binary file added 03_basic_routing/put-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8f7ee96

Please sign in to comment.