From b7becf943944b63dae11d3814d7a1995d41d2ca7 Mon Sep 17 00:00:00 2001 From: Dominik Halfkann Date: Sat, 7 Dec 2024 14:44:16 +0100 Subject: [PATCH] add first request files --- .requests/http-client.env.json | 16 ++++++++++++ .requests/profile.http | 47 ++++++++++++++++++++++++++++++++++ .requests/register.http | 35 +++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 .requests/http-client.env.json create mode 100644 .requests/profile.http create mode 100644 .requests/register.http diff --git a/.requests/http-client.env.json b/.requests/http-client.env.json new file mode 100644 index 0000000..c2338ce --- /dev/null +++ b/.requests/http-client.env.json @@ -0,0 +1,16 @@ +{ + "Lokal": { + "baseUrl": "http://localhost:8080", + "user": { + "email": "1-test@dancier.net", + "password": "CHANGEME" + } + }, + "Test (test.dancier.net)": { + "baseUrl": "https://test-dancer.dancier.net", + "user": { + "email": "1-test@dancier.net", + "password": "CHANGEME" + } + } +} diff --git a/.requests/profile.http b/.requests/profile.http new file mode 100644 index 0000000..fb77a51 --- /dev/null +++ b/.requests/profile.http @@ -0,0 +1,47 @@ +### Login (run once to retrieve access token) +POST {{baseUrl}}/authentication/login +Content-Type: application/json + +{ + "email": "{{user.email}}", + "password": "{{user.password}}" +} +> {% client.global.set("access_token", response.body.accessToken); %} + + +### Get user's proile (and save it) +GET {{baseUrl}}/profile +Authorization: Bearer {{access_token}} + +> {% client.global.set("profile", response.body.toString()); %} + + +### Save user's profile +PUT {{baseUrl}}/profile +Content-Type: application/json + +{ + "size": 130, + "gender": "FEMALE", + "birthDate": "1996-01-19", + "ableTo": [ + { + "dance": "Tango", + "level": "BASIC", + "leading": "LEAD" + } + ], + "wantsTo": [ + { + "dance": "Tango", + "level": "INTERMEDIATE", + "leading": "FOLLOW" + } + ], + "email": "1-test@dancier.net", + "zipCode": "10001", + "city": "Hamburg", + "country": "GER", + "profileImageHash": "1a7efd460ee0be68011291c9f6b1ac5d9b03f9974b66c27b14e59887bf910f8c", + "aboutMe": null +} diff --git a/.requests/register.http b/.requests/register.http new file mode 100644 index 0000000..42d65a3 --- /dev/null +++ b/.requests/register.http @@ -0,0 +1,35 @@ +### Perform Captcha to Login as Human +POST {{baseUrl}}/authentication/loginAsHuman +X-Captcha-Token: token + +> {% client.global.set("access_token", response.body.accessToken); %} + +### Perform initial registration +POST {{baseUrl}}/authentication/registrations +Content-Type: application/json + +{ + "acceptTermsAndConditions": true, + "email": "{{user.email}}", + "password": "{{user.password}}" + +} + +### verify email +PUT {{baseUrl}}/authentication/email-validations/asdf +Authorization: Bearer {{access_token}} + +### Login with new user +POST {{baseUrl}}/authentication/login +Content-Type: application/json + +{ + +} + +> {% client.global.set("access_token", response.body.accessToken); %} + + +### Get user's profile +GET {{baseUrl}}/profile +Authorization: Bearer {{access_token}}