· Feb 1, 2021

REST Consumer sending and Receiving Files

I am trying to write a REST consumer the API that I am talking to expects a file to be sent over and in response I will get a file back if anyone out there has ever had a similar use case please could you kindly guide us or share some sample code please

Product version: Ensemble 2018.1
Discussion (2)1
Log in or sign up to continue


I see in the digest from this week this link . It sounds to be like what you are trying to do. 

Note this is built in IRIS not Ensemble 2018 so it may need tweaking in order to work in your build , i think it will still import with errors in the code. I don't see any headers that say Iris in it, if there is then change the word in the headers to cache. 

I believe you may encounter issues with the code in the link stating .%ToJSON. I think this may have been introduced in IRIS or at least after our version which was 2017,  there's a chance it is in 2018. You may need to use the method  .%WriteJSONStreamFromObject from the  %ZEN.Auxiliary.altJSONProvider or typing up manually the JSON string itself to avoid use of ZEN classes. If you look on my profile i asked a question recently of the .%WriteJSONStreamFromObject