I am using Venus to update compounds in our ELN (Signals) as they are changed in Vantage.
I have installed the HSLHttp library and received valid GET and POST responses. However, the request I need to call on the Signals side is a PATCH and I could not find a HSLHttp::HttpPatch option.
Is there a way too call a PATCH request in Venus (or HSL)?
A patch request is the same as a put request that only updates part of a resource’s state. You could try transferring the entire resource state with a put request if that is supported by HSLHttp
Thank you!
There is a GET and a PATCH for this request. The PATCH is not in the same format as the GET response (just tried that) and there is no documentation about updating the entire schema. I’ve tried using POST and PUT methods to send the requests but both respond with 404.
Looking at the library it seems @WillTurman created HSLHttp - maybe he could advise you on whether the .dll has PATCH functionality that isnt used in the HSL interface…
Decompiling the .dll shows that there isn’t a PATCH function, but you could probably write your own and compile a new version. I’ve attached the PUT function so you can see how its built.
I absolutely stand behind this, it’s a fantastic tool! Depending on the library complexities and dependencies you can sometimes modify the code (you might have to de/reregister depending) to add modifications you might need.
Just be careful as this is definitely out of the scope of device warranties if you are working with any device libraries!
I didn’t include support for the HTTP PATCH method into the HSLHttp library, but only because it was one of the more esoteric HTTP methods and I never had a use case for it.
That said, I haven’t touched that code since I was at Hamilton ~5 years ago and am unsure if it has been updated since then. I imagine some of these tools for working with APIs in Venus are due for some TLC at this point.
Makes sense to me. I agree that PATCH was not a very common verb, especially 5 years ago. It has gained much popularity since then and for the integration I’m using it is required (there is no POST option, server rejects all non-PATCH requests to the URL).
I worked around using Shell to make a cURL PATCH request, but this is indirect and not best practice. I echo that this library is overdue for some upgrading, especially given how common HTTP requesting is with nearly all forms of integration.
Happy to serve as Voice of Customer if needed!
Kyle
Will’s library is now formally maintained by our SW department. If you could prepare a list of functions with needed input/outputs, I can request further development.
The main thing I need is an additional function (“PATCH”). It would have same input/outputs as the existing “POST” function. A way to set headers, send a body, and receive the response. This is all included and works properly in the “POST” request. I really just need that verb to be sent.