Created
August 11, 2024 20:00
-
-
Save goldenratio/5d52949956a3dca9bfdc6d10600d8773 to your computer and use it in GitHub Desktop.
hoppscotch collection for micro blog api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"v":2,"name":"micro-blog-api","folders":[],"requests":[{"v":"6","method":"POST","endpoint":"http://127.0.0.1:8080/echo","testScript":"","requestVariables":[],"params":[],"preRequestScript":"","name":"echo","body":{"contentType":"application/json","body":"{\n \"username\": \"foo\",\n \"password\": \"bar\"\n}"},"auth":{"authActive":true,"password":"sasasa","username":"sasa","authType":"basic"},"headers":[]},{"v":"6","params":[],"preRequestScript":"","name":"auth login","endpoint":"http://127.0.0.1:8080/auth/login","testScript":"const jsonData = pw.response.body;\n// Set an environment variable\npw.env.set(\"jwt_token\", jsonData.jwtToken);\n// pw.env.set(\"user_id\", jsonData.userId);","auth":{"authActive":true,"authType":"inherit"},"body":{"body":"{\n \"email\": \"<<email>>\",\n \"password\": \"password1\"\n}\n","contentType":"application/json"},"method":"POST","requestVariables":[],"headers":[{"value":"application/json","key":"Content-Type","active":true}]},{"method":"POST","requestVariables":[],"headers":[],"preRequestScript":"var random = Math.floor(Math.random() * 1000);\npw.env.set(\"randomInt\", random.toString());\n\npw.env.set(\"email\", `email+${random}@example.com`);\npw.env.set(\"displayName\", `pico+${random}`);\n","name":"auth register","v":"6","endpoint":"http://127.0.0.1:8080/auth/register","params":[],"testScript":"","body":{"contentType":"application/json","body":"{\n \"email\": \"<<email>>\",\n \"password\": \"password1\",\n \"displayName\": \"<<displayName>>\"\n}\n"},"auth":{"authActive":true,"authType":"inherit"}},{"testScript":"const jsonData = pw.response.body;\n// Set an environment variable\npw.env.set(\"post_uuid\", jsonData.postUuid);\n","v":"6","preRequestScript":"","body":{"body":"{\n \"title\": \"title\",\n \"post\": \"hello world!!\"\n}","contentType":"application/json"},"params":[],"requestVariables":[],"method":"POST","headers":[{"active":true,"key":"Content-Type","value":"application/json"}],"endpoint":"http://127.0.0.1:8080/user/post","auth":{"token":"<<jwt_token>>","authType":"bearer","authActive":true},"name":"user-post"},{"v":"6","body":{"body":"{\n \"postUuid\": \"<<post_uuid>>\"\n}","contentType":"application/json"},"headers":[],"params":[],"name":"get post by id","testScript":"","method":"POST","endpoint":"http://127.0.0.1:8080/user/get-post-by-id","preRequestScript":"","requestVariables":[],"auth":{"authType":"bearer","authActive":true,"token":"<<jwt_token>>"}},{"v":"6","endpoint":"http://127.0.0.1:8080/user/get-posts","name":"get all posts","params":[],"headers":[],"method":"POST","auth":{"authType":"bearer","authActive":true,"token":"<<jwt_token>>"},"preRequestScript":"","testScript":"","body":{"contentType":null,"body":null},"requestVariables":[]}],"auth":{"authType":"none","authActive":true},"headers":[]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment