HTTPSocket.Get Returning Error 102

I am having difficulty downloading files from web sites - a few sites work well, but most do not.

Environment:
Windows 10 Professional
Xojo Version 2017 Release 1

The results are consistent and either always work or always fail. I am currently attempting to download a membership list page so I can parse it. Strangely, I can download the site’s home page without issue, but the membership page fails to download. Since it is two pages at the same site, I thought it would be a good example to use in requesting assistance. As a test environment, I created a new project with a single Document window and put the following code in the “Open” Event Handler.

Dim aPage as String
Dim URL1 as String
Dim URL2 As String
Dim socket1 As New HTTPSocket
Dim socket2 As New HTTPSocket

URL1 = "naqcc.info"
aPage = socket1.Get(  URL1, 30  )
If ( aPage <> "" ) Then
  MsgBox "URL1 downloaded successfully" 
Else
  MsgBox "URL1 Download failed - Error Code: " + Str( socket1.LastErrorCode )
End If
break

URL2 = "naqcc.info/memberlist_complete.php"
aPage = socket1.Get(  URL2, 30  )
If ( aPage <> "" ) Then
  MsgBox "URL2 downloaded successfully" 
Else
  MsgBox "URL2 Download failed - Error Code: " + Str( socket1.LastErrorCode )
End If
break

The first download is always successful but the second always fails with Error Code 102.

Thanks in advance for any advice i get.

Ron Bower
Ellicott City, MD

Server might be requiring HTTP 1.1
Try with a Xojo.Net.HTTPSocket - that usually fixes it for me.

Tim -

I’m having some problems understanding exactly how to use Xojo.Net.HTTPSoket but still trying to understand it.

However, since both pages are from the same site and same server, then it doesn’t seem to me that the server would be the problem.

Can someone please try the code out to see if it works for them ?

Thanks to all,
Ron Bower
Ellicott City, MD

Ron - the example works for me. I get both pages, the 2nd takes a few seconds to load due to its size…
-jim

worked fine here
timeout too short on the second request ?

Jim - Thanks for testing and the feedback.

Norman - I have successfully downloaded much large pages such as www.cnn.com but also tested again with a timeout of 60 seconds.

I used those two examples for two reasons - the second page is the one I really want AND both pages are from the same website.

Ron Bower