Question: How do we move the resource using REST API?
Answer: Moving a resource uses the PUT method, whereas copying it uses the POST method.
Please find below Method and URL used to copy the resource:
Method: PUT URL:http://<host>:<port>/jasperserver[-pro]/rest_v2/resources/path/to/folder?<arguments>
The arguments used for this request is as below:
1) createFolders Type/Value: true|false, Description: True by default, and the service will create all parent folders if they do not already exist. When set to false, the folders specified in the URL must all exist; otherwise, the service returns an error.
2) overwrite Type/Value: true|false, Description: When true, the target resource given in the URL is overwritten, even if it is a different type than the resource descriptor in the content. The default is false.
The options used for this request is as below:
Content-Location: {resourceSourceUri} - Specifies the resource to be moved.
The Return values for this request is as below:
a) For Success: 201 Created - The request was successful and, for confirmation, the response contains the full descriptor of the resource that was just moved.
b) For Failure: 204 No Content - 404 Not Found - When the {resourceSourceUri} is not valid.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now