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

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.

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 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: 7 years 10 months 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 - 7 years 11 months ago

0 Answers:

No answers yet