Question
· May 7, 2022

HTTP request using a curl

Hi guys,

 

How do I create a make a http request using curl, I've found samples on how to do it from a command prompt but how to create and make a http post request and get a response with ensemble object and functions?

I guess somthing like :

s req=##class(%Net.httpRequest).%New()

...etc

Or do I build a command run it in ensemble and get a response back, if so how can I do that ?

 

Thanks

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

Hi Rochdi! curl is a software that can make http calls from a command line. 

Are you sure you need curl? Or maybe you need to make http calls from IRIS or Ensemble? 

There are plenty of examples.

E.g. here is a one line to make an http GET request and download  and install ZPM:

    s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

It is an example of http request