Created
June 9, 2012 23:17
-
-
Save NetworksAreMadeOfString/2903007 to your computer and use it in GitHub Desktop.
Example of making an API request to a Chef server to get the Cookbooks list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String Path = "/cookbooks"; | |
this.httpget = new HttpGet(this.ChefURL + Path); | |
List <NameValuePair> Headers = ChefAuth.GetHeaders(Path, ""); | |
for(int i = 0; i < Headers.size(); i++) | |
{ | |
this.httpget.setHeader(Headers.get(i).getName(),Headers.get(i).getValue()); | |
} | |
String jsonTempString = httpClient.execute(this.httpget, responseHandler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment