Hello,
I ask you because i have a problem when i call the function PostUrl of inet, the function return all the time -1.
I call the function in mobile application (android) and appeonserver is on .net IIS.
This is my code :
inet l_inet
internetresult l_internetresult
String s_request, s_param, s_header
Integer i_return
s_request = "https://maps.googleapis.com/maps/api/distancematrix/xml?departure_time=now&traffic_model=best_guess&mode=driving&units=metric&origins=49.443232,1.099971&destinations=48.9851655,2.2466938|49.132338,2.35499|49.026079,2.1041515|49.4279628,1.0888234|48.8897208,2.1731804&key=AIzaSyDknKjYvKMQ8vw-Nw3HY5buwPjNG-EwPgQ"
l_inet = CREATE inet
l_internetresult = CREATE l_internetresult
s_param = Blob("",EncodingAnsi!)
s_headers = "Content-Type: application/x-www-form-urlencoded~nContent-Length: " + String( Len(s_param)) + "~n~n"
i_return = l_inet.PostURL (s_request, s_param, s_headers, 0, l_internetresult)
Somebody can try if he get the same (i_return = -1)
Regards
Thank's for your solution, but it's the same
If i try in mobile, your function f_posturl_mobile return nothing, and if into your function your write this :
integer i_return
i_return = iinet_base.PostURL (as_url, lblb_args, ls_headers, 80, iir_msgbox)
i_return get -1, it's the same of me.
I do myself a workarround, i put the url into the control eon_mobile_webviewex and i use the function
uo_web.of_startloading(s_request)
After into the event oe_loadend() i do this
of_runjavascript( "document.documentElement.innerHTML", s_return)
to get the result come from the url.
You have to put Sleep(1) before call the function of_runjavascript to wait sometime because the event oe_loadend is executed immediatly after the function of_startloading() and if you don't do the sleep(1), you get nothing into the eon_mobile_webviewex object.
I now, this is a patch, bit he work !!!