Package org.ulti.dev.powermeter.util

Examples of org.ulti.dev.powermeter.util.Client.addHeader()


    String url = makeUserUrl() + "/variable";
    _log.info("URL:" + url);

    Client http = new Client();

    http.addHeader("Authorization", "AuthSub token=\"" + _authToken + "\"");
    http.setContentType("application/atom+xml");

    String uploadString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
        + "  <entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:meter=\"http://schemas.google.com/meter/2008\">" + "    <meter:variableId>"
        + varId + "</meter:variableId>" + "    <title>" + title + "</title>" + "    <content type=\"text\">" + description + "</content>"
View Full Code Here


    Client http = new Client();

    String url = makeUserUrl() + "/variable";
    _log.info("URL:" + url);

    http.addHeader("Authorization", "AuthSub token=\"" + _authToken + "\"");
    http.setContentType("application/atom+xml");
    String res = http.getToString(url);

    if (http.getResult() < 200 || http.getResult() > 210) {
      System.err.println("ERROR POST: code=" + http.getResult() + "\n" + res);
View Full Code Here

  private boolean post(String url, String data) {
    Client http = new Client();

    _log.info("PowerMeterActions::post( " + url + ", ... )");

    http.addHeader("Authorization", "AuthSub token=\"" + _authToken + "\"");
    http.setContentType("application/atom+xml");

    _log.trace("POSTing data: " + data);

    Document res = http.postToXML(url, data);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.