owen-script/test.sh
2024-11-24 15:17:27 +03:00

18 lines
556 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
url="https://api.owencloud.ru/v1/auth/open"
login="v.baldin@vrh.ru"
password="балдиНврх"
# Данные для отправки
data="login=$login&password=$password"
# Выполнение POST-запроса с использованием curl
response=$(curl -s -w "%{http_code}" -o response.txt -X POST "$url" \
-H "Accept: */*" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "$data")
# Печать кода статуса и тела ответа
echo "HTTP Status Code: $response"
cat response.txt