PhpStorm Httpclient - как создать запрос x-www-form-urlencoded
Использую keycloack - то есть поменять формат ендпоинта не могу. Хочу отправить x-www-form-urlencoded вида
curl --location 'https://keycloak.some/realms/demo/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=same' \
--data-urlencode 'username=some' \
--data-urlencode 'password=some' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_secret=some' \
--data-urlencode 'scope=openid'
но не получается. как пробую
### Получение токена
# @name /protocol/openid-connect/token
POST {{sso-host}}/realms/{{realm}}/protocol/openid-connect/token
Content-Type: application/x-www-form-urlencoded
client_id:same&username:admin&password:admin&grant_type:password&client_secret:somea&scope:openid
ответ
HTTP/1.1 400 Bad Request
Referrer-Policy: no-referrer
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000; includeSubDomains
Cache-Control: no-store
X-Content-Type-Options: nosniff
Pragma: no-cache
X-XSS-Protection: 1; mode=block
Content-Type: application/json
content-length: 84
{
"error": "invalid_request",
"error_description": "Missing form parameter: grant_type"
}
Источник: Stack Overflow на русском