Subodh Joshi
Subodh Joshi

Reputation: 13482

Keycloak admin-cli throwing - HTTP error - 415 Unsupported Media Type

I am trying to update realm from the admin-cli but end with 415 unsupported Media type.

FYI i did not make any single change in demorealm.json file.

/opt/keycloak/bin/kcadm.sh get realms/CRUE_Realm > demorealm.json
/opt/keycloak/bin/kcadm.sh update realms/CRUE_Realm > demorealm.json 
HTTP error - 415 Unsupported Media Type

Upvotes: 1

Views: 890

Answers (1)

Kohei TAMURA
Kohei TAMURA

Reputation: 5122

Try changing to:

/opt/keycloak/bin/kcadm.sh update realms/CRUE_Realm -f demorealm.json 

See also: Keycloak Documentation19.5. Basic operations and resource URIs

The create and update commands send a JSON body to the server by default. You can use -f FILENAME to read a premade document from a file.

Upvotes: 2

Related Questions