From inside oscript (CSIDE) is it possible to make an HTTPS call without using Java?
eLink : How to make HTTPS call from inside oscript?How to make HTTPS call from inside oscript? Posted by hao.deng@nanavaticonsulting.com (deng, hao) On 07/17/2018 01:20 PM From inside oscript (CSIDE) is it possible to make an HTTPS call without using Java?[To post a comment, use the normal reply function]Forum: Content Server Development ForumContent Server: My Support
As Hans already pointed out it's not possible. For this reason we wrote an OScript wrapper around the Apache HTTPClient library (which is also bundled with CS these days). The interface came out nicely and makes it easy to build a request. E.g.,
Assoc response = $MyHTTPClient.Utils.GetClient('GET', 'https://whatever') \ .setHeader('Authorization', 'Token ' + '....') \ .setAuthUsername(authUsername) \ .setAuthPassword(authPassword) \ .setProxy(proxyAddress, proxyPort, proxyUsername, proxyPassword) \ .addParam('q', 'searchTerm') \ .execute()if response.statusCode == 200 // ...end
I don't know if this helps, but perhaps it offers some ideas on how you could write your own wrapper around the Apache library.
Your wrapper has a nice interface. I wonder, how uglier :-) would be using JavaObject with Apache HTTPClient directly, without the need of wrappers.
Thanks, and indeed it is very ugly. But that's exactly the reason for the wrapper. Behind the scenes it's all JavaObject calls.
Hi All,
Rolling on three years. Is this still the case within CS22.1 ?
I have a client who has an external java piece to receive a call from OScript and then send this on to a 3rd party Rest API using HTTPS. They would like to remove this Java piece as part of their upgrade to CS22.1.
Is this possible?
Thanks
Colin
Have you tested this on 221. server?
Hi,
No. Just found this thread and thought I'd ask the question as to if what it said was still current.