Class PostCommand<ResponseType extends CommandResponse>

java.lang.Object
org.labkey.remoteapi.Command<ResponseType,org.apache.hc.client5.http.classic.methods.HttpPost>
org.labkey.remoteapi.PostCommand<ResponseType>
All Implemented Interfaces:
HasRequiredVersion
Direct Known Subclasses:
AssayListCommand, BaseCreateFolderCommand, BaseQueryCommand, BaseStorageCommand, BaseTransformCommand, CreateContainerCommand, CreateDomainCommand, CreateGroupCommand, CreateUserCommand, DeleteContainerCommand, DeleteGroupCommand, DeleteUserCommand, DropDomainCommand, ExecuteSqlCommand, FileNotificationCommand, GetAssayRunCommand, GroupMembersCommand, ImpersonateUserCommand, ImportDataCommand, ImportRunCommand, ListDomainsCommand, LoadAssayBatchCommand, LogoutCommand, RenameContainerCommand, RenameGroupCommand, SaveAssayBatchCommand, SaveAssayRunsCommand, SaveDomainCommand, SaveProtocolCommand, SaveRowsCommand, SimplePostCommand, SqlExecuteCommand, StartSearchCommand, StopImpersonatingCommand, TruncateTableCommand, UpdateParticipantGroupCommand

public abstract class PostCommand<ResponseType extends CommandResponse> extends Command<ResponseType,org.apache.hc.client5.http.classic.methods.HttpPost>
Base class for all commands that need to post data to the server, rather than providing parameters in the query string.

Client code will not use this class directly, but will instead use one of the classes that extend this class (e.g., UpdateRowsCommand).

If a developer wishes to invoke actions that require POST and are not yet supported with a specialized class in this library, the developer may invoke these APIs by creating an instance of the SimplePostCommand class and setting the JSON object to post.

  • Constructor Details

    • PostCommand

      protected PostCommand(String controllerName, String actionName)
      Constructs a new PostCommand given a controller and action name.
      Parameters:
      controllerName - The controller name.
      actionName - The action name.
  • Method Details

    • getJsonObject

      public org.json.JSONObject getJsonObject()
      Returns the JSON object to post or null for no JSON. Override this method to provide parameters as JSON.
      Returns:
      The JSON object to post.
    • createRequest

      protected org.apache.hc.client5.http.classic.methods.HttpPost createRequest(URI uri)
      Creates the HttpPost instance used for the request. Override to modify the HttpPost object before use or to send something other than JSON in the post body. In your override, create the HttpPost and set the request entity appropriately.
      Specified by:
      createRequest in class Command<ResponseType extends CommandResponse,org.apache.hc.client5.http.classic.methods.HttpPost>
      Parameters:
      uri - the uri to convert
      Returns:
      The PostMethod object.