1. Samuel Sanchez Avila
  2. PowerBuilder
  3. Wednesday, 8 January 2020 18:54 PM UTC

In PowerBuilder 2019, the way to connect a Rest-Api is with this:

 

Application Window--
client= CREATE RESTClient
client.SetRequestHeader("Content-Type","application/json")
client.SetRequestHeader("Accept-Encoding","gzip")

Function Window--

String  ls_C019_ResPonse

RestClient lrc_C019
lrc_C019 = Create RestClient

//Connect to RestApi
lrc_C019.SendGetRequest('http://localhost:8080/api/'+api_data, ls_C019_ResPonse)

//Returned Info:
Messagebox("",ls_C019_ResPonse)

 

Is there a way to connect my Rest-Api, or something like this, using PB 2017 R3?

--PB 2017 mark error in: lrc_C019.SendGetRequest( , )

 

Thanks.

 

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
  1. Wednesday, 8 January 2020 20:48 PM UTC
  2. PowerBuilder
  3. # Permalink

Hello,

you can use HTTPClient object, it works pretty much the same if you do not need automatic display of REST response into a DW.

See some examples here:

https://docs.appeon.com/appeon_online_help/pb2017r3/powerscript_reference/ch10s566.html

Best,

.m

 

Comment
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.