Package edu.wpi.cs.wpisuitetng.network

Examples of edu.wpi.cs.wpisuitetng.network.Request


    String password = new String(view.getPasswordField().getPassword());
    String credentials = view.getUserNameField().getText() + ":" + password;
    basicAuth += Base64.encodeBase64String(credentials.getBytes());

    // Create and send the login request
    Request request = Network.getInstance().makeRequest("login", HttpMethod.POST);
    System.out.println(basicAuth);
    request.addHeader("Authorization", basicAuth);
    request.addObserver(new LoginRequestObserver(this));
    request.send();
  }
View Full Code Here


      }
     
      System.out.println(Network.getInstance().getDefaultNetworkConfiguration().getRequestHeaders().get("cookie").get(0));

      // Select the project
      Request projectSelectRequest = Network.getInstance().makeRequest("login", HttpMethod.PUT);
      projectSelectRequest.addObserver(new ProjectSelectRequestObserver(this));
      projectSelectRequest.setBody(ConfigManager.getConfig().getProjectName());
      projectSelectRequest.send();
    }
    else {
      JOptionPane.showMessageDialog(view, "Unable to login: no cookies returned.", "Login Error",
          JOptionPane.ERROR_MESSAGE);
    }
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.network.Request

Copyright © 2018 www.massapicom. 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.