Package org.labkey.remoteapi
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.labkey.remoteapi.Command
Command.CommonParameters, Command.Response
-
Field Summary
Fields inherited from class org.labkey.remoteapi.Command
CONTENT_TYPE_JSON
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PostCommand
(String controllerName, String actionName) Constructs a new PostCommand given a controller and action name. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hc.client5.http.classic.methods.HttpPost
createRequest
(URI uri) Creates theHttpPost
instance used for the request.org.json.JSONObject
Returns the JSON object to post or null for no JSON.Methods inherited from class org.labkey.remoteapi.Command
_execute, createParameterMap, createResponse, execute, getActionName, getControllerName, getHttpRequest, getParameters, getParamValueAsString, getRequiredVersion, getTimeout, setRequiredVersion, setTimeout
-
Constructor Details
-
PostCommand
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
Creates theHttpPost
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 classCommand<ResponseType extends CommandResponse,
org.apache.hc.client5.http.classic.methods.HttpPost> - Parameters:
uri
- the uri to convert- Returns:
- The PostMethod object.
-