how to post a text file to jasper reports server using rest v2 with json

0

I am trying to send a simple txt file to the JasperResports server (5.6.0 release) using a POST/json request.  I keep getting back client 400 error after the post.  I have read the docs but cannot figure out what is wrong.  If someone could post the exact headers and json content for a sample request to send a small txt file, I would greatly appreciate it.  

 

One thing I cannot understand is if the post headers are correct.  There is much discussion in http://community.jaspersoft.com/documentation/jasperreports-server-web-s... in the "Content Header Type" section but there are no concrete exampes so I am not sure what is supposed to be given for the header for say a "txt" file (I am just using the vanilla 'Content-type': 'application/json' but I susplect this migh be wrong).

 

Below are my headers and content (I have edited it for readability and the content is uu64 encoded) (sorry, I had to post the following as an image because my question was being flagged as spam):

 

 

 
taggart's picture
Joined: Jun 5 2014 - 3:25pm
Last seen: 5 years 1 week ago

I was able to figure this out.  The problem was in fact my post header.  It needed to be:

PostHeaders={'Content-type': 'application/repository.file+json', 'accept': 'application/json'}

Everything else I showed in my question was correct.
 

 

 

taggart - 5 years 3 weeks ago

0 Answers:

No answers yet
Feedback
randomness