Skip to Content
0

GetUrl return codes

Oct 18, 2016 at 03:41 PM

82

avatar image

Is there any way to get more detail, when you get a -1 (general error) when calling geturl

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Roland Smith Oct 18, 2016 at 04:22 PM
1

I have an example that uses the Win API functions that the GetURL function does, it might work better.

http://www.topwizprogramming.com/freecode_winhttp.html

Share
10 |10000 characters needed characters left characters exceeded
René Ullrich Oct 19, 2016 at 05:56 AM
0

A reason for -1 return code may be a timeout. But I don't know a way to get more details when using this function.

Instead of using powerbuilder functions or Win APIs you may also use Microsoft ActiveX Objects:

https://msdn.microsoft.com/en-us/library/ms535874%28v=vs.85%29.aspx

a simple example:

oleobject lole_XmlHttp
string ls_url = "http://..."
TRY
   lole_XmlHttp = create oleobject
   lole_XmlHttp.ConnectToNewObject ("Msxml2.XMLHTTP")
   lole_XmlHttp.Open ("GET", ls_url, FALSE)
   lole_XmlHttp.Send ()
   // check for status (lole_XmlHttp.status) and result (lole_XmlHttp.ResponseBody)
CATCH (OLERuntimeError errole)
   // useful: errole.GetMessage() and errole.Description
CATCH (Throwable e)
   // useful: e.GetMessage()
FINALLY
   lole_XmlHttp.DisconnectObject ()
   DESTROY lole_XmlHttp
END TRY

Share
10 |10000 characters needed characters left characters exceeded