[Info-vax] Restful API w/JSON client package or library on OpenVMS
Arne Vajhøj
arne at vajhoej.dk
Wed Mar 13 22:28:48 EDT 2024
On 3/13/2024 10:19 PM, Dave Froble wrote:
> On 3/13/2024 8:39 PM, Arne Vajhøj wrote:
>> There are code examples for client in Java, Groovy, Python,
>> PHP, C and Pascal here:
>> https://www.vajhoej.dk/arne/articles/vmsipc.html#rest
>>
>> I guess I could come up with a Basic example similar to
>> the Pascal example.
>>
>> But else:
>>
>> Basic program--(binary/socket)--Java/Groovy/Python gateway
>> program--(JSON/HTTP)-->web service
>>
>> should not be that bad.
>
> I have some code that does an HTTPS POST written in Basic. Also have
> some code that does a DNS lookup from VMS. Available to whoever asks.
>
> Note, the code uses some code written in C. Some things I don't know
> how to do from Basic.
I got something like that as well.
https://www.vajhoej.dk/arne/articles/vmsipc.html#http_wrap
https://www.vajhoej.dk/arne/articles/vmstd12.html#bas
> As for Restful, I have no experience. But if you do the POST, you then
> have the reply which can be parsed and used.
With REST you sometimes chose to ignore the body in the reply to POST.
The REST convention for POST is that the request body contains the
new item to be added to collection and the reply body contain the
same item with any attributes added server side. But if the server
side is not adding any attributes, then there is no need to parse
the reply body as it then just contains the same as in the request
body.
Arne
More information about the Info-vax
mailing list