Hello Folks,
I am trying to call a REST webservice from my PowerBuilder 2021 application. I have been provided with a URL and a userid/password to authenticate. I am following our friend Bruce's REST tutorial. I created an external DW with one column and assigned it to dw_1. Here is my code:
String ls_URL, ls_mess
Integer li_rtn
RESTClient rest
ls_URL = 'http://my-url.cloud:7780'
rest = Create RESTClient
rest.Retrieve (dw_1, ls_URL)
li_rtn = rest.GetResponseStatusCode ()
ls_mess = rest.GetResponseStatusText ()
Messagebox ('REST', 'Code: ' + String (li_rtn) + '~r~n' + ls_mess)
I get 401 - Not Authorized. How do I pass the userid/password to the webservice ?
Thank You
String ls_jason = '{"empId":101, "fname":" John", "lname": "Guevara"}'
li_rc = HttpClient.SendRequest ( "POST", " https://<url>/<method", ls_json )
ls_URL = 'http://my-url.cloud:7780/api/getOrder'
ls_strIN = '"orderID":"test123"'
li_rc = lhc_Client.SendPostRequest (ls_URL, ls_strIN, ls_Response)