chakras Posted April 23, 2014 Share Posted April 23, 2014 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. img/ prop 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 logINFO: 2 * Client out-bound request2 > PUT http://localhost:8081/jasperserver-pro/rest_v2/resources/temp/book.properties?createFolders=true&overwrite=false2 > Cookie: $Version=1;JSESSIONID=76FACBE4D641DAE6F8D5E6F2DD9D8068;$Path=/jasperserver-pro/2 > Content-Type: application/json2 > Accept: application/json2 > 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 logINFO: 2 * Client in-bound response2 < 2002 < Transfer-Encoding: chunked2 < Date: Wed, 23 Apr 2014 18:44:17 GMT2 < P3P: CP="ALL"2 < Expires: Wed, 31 Dec 1969 19:00:00 EST2 < Set-Cookie: userLocale=en_US;Expires=Thu, 24-Apr-2014 18:44:17 GMT;HttpOnly2 < Content-Type: application/json2 < Server: Apache-Coyote/1.12 < Cache-Control: private2 < {"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 More sharing options...
chakras Posted April 24, 2014 Author Share Posted April 24, 2014 I could resolve this. For reference all it needed is the correct content-type. Link to comment Share on other sites More sharing options...
Recommended Posts
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