Package edu.wpi.cs.wpisuitetng.network

Examples of edu.wpi.cs.wpisuitetng.network.Request.send()


    // set the canned response and start the server
    server.setResponse(cannedResponse);
    server.start();

    // Send the request!
    manualRequest.send();

    assertTrue(manualRequest.getResponse().getBody().contains(body))// check that the message in the body was read
    assertEquals(400, manualRequest.getResponse().getStatusCode());

    assertTrue(body.equals(server.getLastReceived().getBody()));
View Full Code Here


    // 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();
  }

  /**
   * Method that is called by {@link LoginRequestObserver} if the login
   * request was successful.
View Full Code Here

      // 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
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.