Jump to content
We've recently updated our Privacy Statement, available here ×

REST v2 upload Resources


chakras

Recommended Posts

I am trying to upload a resource to Jasper Server using REST API v2. I am sending (HTTP PUT) the 'type' as 'img' or 'jar' or 'prop' as the case may be with the resource descriptor. The file uploads successfully to the server however, the resource type is lost. I get back 'unspecified' See below. Please advise how I can fix this. I do see 'jar' does add the type properly. imgprop does not. Also, if the resource already exists on the server, I get back a HTTP response code of 200 instead of 201 as documented. Is this the expected behavior?

Request:

Apr 23, 2014 2:44:17 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 2 * Client out-bound request
2 > Cookie: $Version=1;JSESSIONID=76FACBE4D641DAE6F8D5E6F2DD9D8068;$Path=/jasperserver-pro/
2 > Content-Type: application/json
2 > Accept: application/json
2 > Content-Disposition: attachment; filename=book.properties
{"content":"<REMOVED>","creationDate":"2014-04-23 14:44:17","permissionMask":"0","label":"book.properties","type":"prop","uri":"/temp/book.properties","updateDate":"2014-04-23 14:44:17","version":"0"}

Response:

Apr 23, 2014 2:44:17 PM com.sun.jersey.api.client.filter.LoggingFilter log
INFO: 2 * Client in-bound response
2 < 200
2 < Transfer-Encoding: chunked
2 < Date: Wed, 23 Apr 2014 18:44:17 GMT
2 < P3P: CP="ALL"
2 < Expires: Wed, 31 Dec 1969 19:00:00 EST
2 < Set-Cookie: userLocale=en_US;Expires=Thu, 24-Apr-2014 18:44:17 GMT;HttpOnly
2 < Content-Type: application/json
2 < Server: Apache-Coyote/1.1
2 < Cache-Control: private
2 < 
{"version":1,"permissionMask":1,"creationDate":"2014-04-23 14:24:27","updateDate":"2014-04-23 14:44:17","label":"book.properties","description":null,"uri":"/temp/book.properties","type":"unspecified","content":null}

Thanks and appreciate any help.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...