To be completely honest, I turned my attention to the provided example because I have this error in one of my projects
The code:
Dim socket1 As New HTTPSocket
Dim data As String = socket1.Get("http://www.xojo.com/", 30)
The returned error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">?<html><head>?<title>301 Moved Permanently</title>?</head><body>?<h1>Moved Permanently</h1>?<p>The document has moved <a href="https://www.xojo.com/">here</a>.</p>?</body></html>?
The replacement character is in the original string.
I forgot to say that the provided URL (here: http://www.xojo.com/) is valid in a browser (HTMLViever based or Firefox, Safari, etc.) The error is elsewhere.
HTTP error 301 simply means that the content you have requested has been moved to another url. If you were to check the status in the HeadersReceived event and in the event of 301 or 302, you can read the Location header to get the new url you should be requesting.
Unfortunately, I do not understand imagine that the code I shared above is the only code in a brand new project (MsgBox data have to be added to be complete) in a PushButton.
I investigated a little bit and the value in the returned header (Location) is https://www.xojo.com/. If I use that value, I get the same redirection error string.
I get the same result if I use https://www.xojo.com/ in Get
In four words: I do not understand (or three: I am lost).
Not only xojo.com. As I wrote in the original question, I come there because I got that in a project (but with a different web location).
I try your code and IT WORKS ! As is I only changed the URL (Xojo) to my own (one of those I use in the original project).
NICE I just have to change my original project (I hope so) and the business will resums as usual !
Good catch Andrew ! Thanks a lot !
Edit:
I noticed the difference in the Classic and new Framework HTTPSocket (1 vs 1.1), but since the documentation says nothing (for once that I noticed something).
Many, but not all, HTTPS web sites will exhibit this problem when using Xojo’s HTTPSecureSocket class. This started happening in 2014 as a result of the response to the “Heartbleed” bug, which affects servers that use OpenSSL. These servers have been reconfigured to refuse connections that use TLSv1.0 and older, but HTTPSecureSocket uses TLSv1.0 as its default.
thank you for the tip. I was able to do a skeleton of what I wanted to do (a method replacement for the part that does not worked in the original project).
The code needs some refinements, but it works fine.