18 lines
728 B
Bash
18 lines
728 B
Bash
#!/usr/bin/env bash
|
||
|
||
# Все запросы будут иметь заголовок Authorization: Bearer $ACCESS
|
||
# 404, если профиля ещё нет — это корректно
|
||
curl -sS http://localhost:8080/profiles/v1/profiles/me \
|
||
-H "Authorization: Bearer $ACCESS"
|
||
|
||
# Создание профиля
|
||
printf '%s' \
|
||
'{"gender":"female","city":"Moscow","languages":["ru","en"],"interests":["music","travel"]}' \
|
||
| POST -H "Authorization: Bearer '"$ACCESS"'" \
|
||
-H "Content-Type: application/json" \
|
||
http://localhost:8080/profiles/v1/profiles
|
||
|
||
# Теперь должен отдать ваш профиль
|
||
curl -sS http://localhost:8080/profiles/v1/profiles/me \
|
||
-H "Authorization: Bearer $ACCESS"
|