NATD
8/7/2014 - 1:51 AM

Post Request

Post Request

// Model represent Login
Login login = new Login("example@example.com", "password", "Rest Api V1");

// Post request
Post post = new Post("http://localhost:3000/api/v1/login", login.toJson())
    .header("Content-Type", "application/json")
    .header("Access-Token", "a1a4k0z7c3a4b4l1b6n3i|R8J3Z6o0C0q1F3i7v4X5C0g8W3q7i5")
    .execute();
    
    // Retrive all data
    System.out.println(post.body());
    System.out.println(post.headers());
    System.out.println(post.responseCode());
    System.out.println(post.responseMessage());