Skip to content

Instantly share code, notes, and snippets.

@evsapi
Forked from kinlane/configureAccount.java
Created May 14, 2012 21:28
Show Gist options
  • Save evsapi/2697301 to your computer and use it in GitHub Desktop.
Save evsapi/2697301 to your computer and use it in GitHub Desktop.
IDrive - EVS - REST API - configureAccount
String params="uid="+strUser+"&pwd="+strPass+"&enctype=private&pvtkey="+strEncKey;
URL evsURL = new URL("https://<server address>/evs/configureAccount");
HttpURLConnection con = (HttpURLConnection)evsURL.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
DataOutputStream out = new DataOutputStream (con.getOutputStream());
out.writeBytes(params);
out.flush();
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
while((str = in.readLine()) != null)
{
result += str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment