|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.labkey.remoteapi.Command<ResponseType>
org.labkey.remoteapi.PostCommand<ResponseType>
public class PostCommand<ResponseType extends CommandResponse>
Base class for all commands that needs to post data to the server, rather than providing parameters in the query string.
Client code will not typically use this class directly, but will
instead use one of the classes that extend this class (e.g.,
UpdateRowsCommand).
However, if future versions of the LabKey Server expose new HTTP APIs requiring a POST
that are not yet supported with a specialized class in this library,
the developer may still invoke these APIs by creating an instance of the
PostCommand object directly, providing the controller and action name for
the new API. The post body may then be supplied by overriding the
getJsonObject() method, returning the JSON object to post.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.labkey.remoteapi.Command |
|---|
Command.CommonParameters |
| Field Summary |
|---|
| Fields inherited from class org.labkey.remoteapi.Command |
|---|
CONTENT_TYPE_JSON |
| Constructor Summary | |
|---|---|
PostCommand(PostCommand source)
|
|
PostCommand(java.lang.String controllerName,
java.lang.String actionName)
Constructs a new PostCommand given a controller and action name. |
|
| Method Summary | |
|---|---|
PostCommand |
copy()
Returns a copy of this object. |
protected org.apache.commons.httpclient.HttpMethod |
createMethod()
Overrides Command.createMethod() to create a
PostMethod object. |
org.json.simple.JSONObject |
getJsonObject()
Returns the JSON object to post, or null if the JSON object has not yet been set. |
void |
setJsonObject(org.json.simple.JSONObject jsonObject)
Sets the JSON object to post. |
| Methods inherited from class org.labkey.remoteapi.Command |
|---|
createResponse, execute, getActionName, getActionUrl, getControllerName, getHttpMethod, getParameters, getParamValueAsString, getQueryString, getRequiredVersion, getTimeout, setParameters, setRequiredVersion, setTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PostCommand(java.lang.String controllerName,
java.lang.String actionName)
controllerName - The controller name.actionName - The action name.public PostCommand(PostCommand source)
| Method Detail |
|---|
public org.json.simple.JSONObject getJsonObject()
public void setJsonObject(org.json.simple.JSONObject jsonObject)
jsonObject - The JSON object to postprotected org.apache.commons.httpclient.HttpMethod createMethod()
Command.createMethod() to create a
PostMethod object.
Override this method if your post command sends something other than JSON in the post body. In your override, create the PostMethod and set the RequestEntity appropriately.
createMethod in class Command<ResponseType extends CommandResponse>public PostCommand copy()
Command
copy in class Command<ResponseType extends CommandResponse>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||