Class MiniClient

java.lang.Object
i5.las2peer.connectors.webConnector.client.MiniClient

public class MiniClient extends Object
Very simple client to communicate with the las2peer web connector
  • Constructor Details

    • MiniClient

      public MiniClient()
  • Method Details

    • setAddressPort

      @Deprecated public void setAddressPort(String address, int port)
      Deprecated.
      Use setConnectorEndpoint(String) instead. set address and port
      Parameters:
      address - address of the server
      port - if 0 no port is appended to the address
    • setConnectorEndpoint

      public void setConnectorEndpoint(String endpoint)
      Sets the connectors endpoint URI this client should connect to.
      Parameters:
      endpoint - A connector endpoint like http://localhost:12345, with no trailing slash
    • setLogin

      public void setLogin(String username, String password)
      set login data
      Parameters:
      username -
      password -
    • sendRequest

      public ClientResponse sendRequest(String method, String uri, String content, String contentType, String accept, Map<String,String> headers)
      send request to server
      Parameters:
      method - POST, GET, DELETE, PUT
      uri - REST-URI (server address excluded)
      content - if POST is used information can be embedded here
      contentType - value of Content-Type header
      accept - value of Accept Header
      headers - headers for HTTP request
      Returns:
      returns server response
    • sendRequest

      public ClientResponse sendRequest(String method, String uri, String content, Map<String,String> headers)
      send request to server
      Parameters:
      method - POST, GET, DELETE, PUT
      uri - REST-URI (server address excluded)
      content - if POST is used information can be embedded here
      headers - headers for HTTP request
      Returns:
      returns server response
    • sendRequest

      public ClientResponse sendRequest(String method, String uri, String content)
      send request to server
      Parameters:
      method - POST, GET, DELETE, PUT
      uri - REST-URI (server address excluded)
      content - if POST is used information can be embedded here
      Returns:
      returns server response