Publish Restful returning object as base64string (>65535)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
Dino
Posts: 133
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Publish Restful returning object as base64string (>65535)

Post by Dino » Thu Apr 29, 2021 10:59 am

Hi

I am trying to publish a restful API, using a server module, but I want to return between that information, an object with base64string information.
Starting with the basic example, I would think the idea is to add another property and instead of making it a field, make it an object, then populate the object with something like this...

#STD_QSEL := 'c:\temp\DIYStand.pdf'
#File.FromFile Path(#STD_QSEL)
#File.FromBase64String String(#File.AsBase64String)

but when trying to add a property, Type Object, it keeps telling me that it need an Schema property...

Has anyone done that yet? Any ideas how to approach it?

thank you

Dominik
Posts: 20
Joined: Fri Jun 10, 2016 12:14 pm

Re: Publish Restful returning object as base64string (>65535)

Post by Dominik » Fri May 07, 2021 6:01 pm

Hi Dino, did you uh, add a schema property like it suggests?

An object is a JSON object, a collection of String, Number, Array properties lumped together. It is not an object until it has at least one property.

A base64 string encoded file would be a string type property in your object.

Post Reply