You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74Lines changed: 74 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,77 @@ My endeavour to learn Rust started a couple of weeks ago and it's been quite int
5
5
This project is the first one I created following the book "Rust web development" [https://www.manning.com/books/rust-web-development]. Intersting book that let you build from start to finish a small api, BUT, at the end the project does not fully work as expected.
6
6
7
7
Here, you can see some differences from the original project that I need to add to make it work as expected. Hope that it can help someone else!
8
+
9
+
## Test the endpoints
10
+
11
+
You can use the following curl scripts to test. Don't forget to rename the "<auth-token>" and pay atention on the ids!
12
+
13
+
### get questions
14
+
```
15
+
curl --location 'localhost:8080/questions'
16
+
```
17
+
18
+
### post a question
19
+
```
20
+
curl --location 'localhost:8080/questions' \
21
+
--header 'Content-Type: application/json' \
22
+
--header 'Authorization: <auth-token>' \
23
+
--data '{
24
+
"id": "2",
25
+
"title": "New question",
26
+
"content": "brexit was a shitty idea!",
27
+
"tags": [
28
+
"general"
29
+
]
30
+
}'
31
+
```
32
+
33
+
### update question
34
+
```
35
+
curl --location --request PUT 'localhost:8080/questions/1' \
0 commit comments