Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

VCO Rest API working through browser rest clients but throwing HTTP Status code 400 through Java code

$
0
0

I'm trying to make a get request to /plugins to get a list of all plugins installed on my VCO setup. I'm using Basic authorization and encoding the SSO username and password. This works in firefox and chrome's rest clients, but when I run the following code, it gives a 400 HTTP Status code, with no output from the request.

 

HttpGet httpget = new HttpGet("https://" + vcoIp + ":8281/vco/api/plugins/");

DefaultHttpClient client = new DefaultHttpClient();

client = (DefaultHttpClient) TrustAllTrustManager.wrapClient(client);

String encoding = Base64.encodeBase64String((ssoUserName + ":" + ssoPassword).getBytes());

 

httpget.setHeader("Authorization", "Basic " + encoding);

httpget.setHeader("Accept", "application/xml");

 

HttpResponse response = client.execute(httpget);

 

Any idea what I could be doing wrong?


Viewing all articles
Browse latest Browse all 6251

Trending Articles