Package org.onyx.http

Class Client

java.lang.Object
org.onyx.http.Client

public class Client extends Object
The Client object encapsulates access to the ledger API server.
  • Constructor Details

  • Method Details

    • hello

      public <HelloReponse> void hello() throws ChainException
      Throws:
      ChainException
    • request

      public <T> T request(String action, Object body, Type tClass) throws ChainException
      Perform a single HTTP POST request against the API for a specific action.
      Parameters:
      action - The requested API action
      body - Body payload sent to the API as JSON
      tClass - Type of object to be deserialized from the response JSON
      Returns:
      the result of the post request
      Throws:
      ChainException
    • credential

      public String credential()
      Returns the credential (possibly null).
      Returns:
      the credential
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare
      Returns:
      a boolean specifying equality