- Marcos Bolonha
- PowerServer Mobile (Obsolete)
- Monday, 13 April 2020 01:26 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.