1

Good day, I am trying to consume a get method on a server hosted locally.

 rc = http_url_get('http://sss:13013/cgi-bi/sendms?'
                        + 'username=cous&pas'
                        + 'to=' + vCell + '&text=' + %TRIM(vSMSText):
                        '/tmp/httptest.html');

I am using a library called HTTPAPI its from https://www.scottklement.com/httpapi/ I am trying to figure out how to get the response of the call as a string.

The Variable rc contains a integer response code but no response, I am assuming it gets downloaded to the /tmp/httptest.html parameter specified. But I want it as a string as I want to process the response as a string. I do not know if there is a extra parameter that I can use to store the result of the call.

I have tried the http_string method but I get an error that the method is undefined, I think the my client is using an old version of the HTTPAPI lib.

Is it possible to use the http_url_get function to return the response as a string?.

Renier
  • 1,738
  • 3
  • 24
  • 51
  • Have you checked out this link where Scott Klement provides some examples [HTTPAPI Examples](https://www.scottklement.com/presentations) ? As I recall, it has overviews on creating SOAP documents to consume web services along with other examples of retrieving data. See if that helps. – NoDakker Jul 13 '22 at 19:41

1 Answers1

0

if you want to get a string response, use Klement's HTTP_req(). It is flexible enough to get a file or a string (and use a file or a string to send a request). You can play with *omit to select the way you can make a GET (on other actions).

Jorge Ubeda
  • 193
  • 5
  • 18