HTTPSecureSocket issues

Dim Socket As New HTTPSecureSocket
  Socket.Secure = True
  Socket.SetRequestHeader("User-Agent:", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36")
 //Dim response As String = Socket.Get("https://google.com", 30)
  Dim response As String = Socket.Get("https://facebook.com", 30)
  response = DefineEncoding(response, Encodings.UTF8)
  debugWindow.debugTextArea.Text = response

For some reason this just shows a blank page when accessing facebook, and when i use google it just shows a page has moved… Has anyone else experienced this with HTTPSecureSocket ?

What’s the HTTPStatusCode when you visit both websites?

Page has moved is usually a redirect (HTTPStatusCode starts with 3xx)

both are showing 301…

Google is fixed by adding www. in front of the domain… facebook however returns 302 (and a blank page) any thoughts?

Both are redirects. You have to manually follow the redirect (since Xojo’s HTTPSocket doesn’t automatically redirect like in other frameworks). Loop through the PageHeaders, find the URL value of “Location”, and do another get with that URL.