Class ClientAPI

java.lang.Object
za.co.wethinkcode.robots.api.ClientAPI

public class ClientAPI extends Object
The Client API class provides generic methods for interacting with the Robot Worlds API as a client
  • Constructor Details

    • ClientAPI

      public ClientAPI()
  • Method Details

    • createRequest

      public static String createRequest(String roboName, InputParser parser)
      builds a JSON request for the server. // format : { "robot": "name", "command": "cmd", "arguments": ["arg1"] }
    • extractMessage

      public static String extractMessage(String jsonResponse)
    • formatResponse

      public static String formatResponse(String jsonResponse)
    • rawToJson

      public static com.google.gson.JsonObject rawToJson(String rawInput)
      Take in the raw response from a server and format it as a JSON object
      Parameters:
      rawInput - the raw input received from the server
      Returns: