I'm having problems trying to authenticate using org.jboss.resteasy.client.jaxrs ResteasyClient.
If I create a request pointing to https://vcdServer/api/versions it works correctly. But against https://vcdServer/api/sessions it gives me an errorCode 500 (Internal server error)
If I use "curl" in command line it works correctly:
curl -i -k -H "Accept:application/*+xml;version=1.5" -u "administrator@System:pass" -X POST https://vcdServer/api/sessions
Here is my testing program:
String authHeader = BasicAuthHelper.createHeader("administrator@System","pass");
ResteasyClient client = new ResteasyClientBuilder().disableTrustManager().build();
ResteasyWebTarget target = client.target("https://vcdServer/api/sessions");
target.request().header("Authorization", authHeader);
target.request().header("Accept", "application/*+xml;version=1.5");
Response response = target.request().post(Entity.text(""));
System.out.println(response.getStatus());
Any ideas?
Thanks a lot,
D.
---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian