Hi,
I'm getting an undefined error message when using HTTPClient object on mobile app. It is returning 0, but this code is not listed as a valid return result.
Integer li_rc
String ls_string
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient
// Sends request using GET method
li_rc = lnv_HttpClient.SendRequest("GET", "https://www.receitaws.com.br/v1/cnpj/00394460005887")
// Obtains the response data
if li_rc = 1 then
lnv_HttpClient.GetResponseBody(ls_string)
messagebox("Success",ls_string)
else
messagebox("Failed","SendRequest Failed: Ret code: "+string(li_rc)+" - Msg: "+lnv_HttpClient.getresponsestatustext())
end if
This API can be executed with success from any browser, and also by running it directly on PB.
Environment:
PowerBuilder CloudPro Edition - version 2019 R2 - build 2323
PowerServer (PB Edition) 2020 Build 2323.00
Android 9
Thanks in advanced.
Marcos
Thanks for replying.
According to Appeon Documentation the HTTPClient is supported by PS2020 mobile:
https://docs.appeon.com/appeon_online_help/ps2020/features_help_for_appeon_mobile/supported_objects_for_mobile.html#Objects_HTTPClient
Also as you can see in the link below I tested HTTPClient successfuly some months ago, when Marco Meoni answered my question about a similar problem:
https://community.appeon.com/index.php/qna/q-a/update-rows-using-httpclient-webapi-on-mobile-app
In case HTTPClient really cannot be used on PS2020, could you give me some advise the best way to consume Web API on mobile app?
Regards.
Marcos
"HTTPClient does not support SSL for PowerServer Mobile".