spierepf Posted June 19, 2012 Share Posted June 19, 2012 Greetings,I am trying to create a simple file resource using the REST API provided by JasperReports Server. Here is the request I am sending, and the response I am receiving:POST /report/rest/resource/ HTTP/1.1Host: localhost:8080Accept: */*; q=0.5, application/xmlAuthorization: Basic c3VwZXJ1c2VyOnN1cGVydXNlcg==Content-Type: multipart/form-data; boundary=550854Accept-Encoding: gzip, deflateContent-Length: 315--550854Content-Disposition: form-data; name="ResourceDescriptor"<resourceDescriptor name="file_test" uriString="/file_test" wsType="img"> <label>REST created resource</label></resourceDescriptor>--550854Content-Disposition: form-data; name="/file_test"this is the content of the file--550854--and this is the response:HTTP/1.1 400 Bad RequestServer: Apache-Coyote/1.1Set-Cookie: JSESSIONID=5DA46D965D0410186DABF835FC7B8BC0; Path=/report/; HttpOnlyContent-Type: text/xml;charset=UTF-8Content-Length: 22Date: Mon, 18 Jun 2012 20:36:27 GMTConnection: closePremature end of file.Has anyone had any success creating file resources using the REST service? Link to comment Share on other sites More sharing options...
Ching Ice-creaming Posted June 19, 2012 Share Posted June 19, 2012 What is your request ? You did not attach any ResourceDescriptor. Hints: JasperServer has working examples: /jasperserver/jasperserver-rest/src/main/java/com/jaspersoft/jasperserver/rest/test Link to comment Share on other sites More sharing options...
spierepf Posted June 20, 2012 Author Share Posted June 20, 2012 The first 'part' of the request is the resource descriptor: <resourceDescriptor name="file_test" uriString="/file_test" wsType="img"> <label>REST created resource</label></resourceDescriptor> 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