Thanks for your suggestions.[quote=274440:@Michel Bujardet]Christian has plugins to get the HTML code within an HTMLViewer. Then you clean it up of the HTML code and you are fine.[/quote]
Cleaning it up is not a problem, but it is a pity to have to install a pluging just to read something that Xojo must know since it was able to write it on the HTMLViewer.
There is a method “LoadPage” but unfortunately there is no method to get the shown code, something like “SavePage”. That is something we usually do in the browser by right-clicking on the page.
Youre definitely missing some header stuff as others have suggested. Its either the missing user agent or the script is being limited to an http 1.1 request and the regular HTTP socket still makes an http1.0 request. The full set of headers when I connect to something with safari that are sent is:
GET /something/else/yes HTTP/1.1
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17
You can add the user agent to it with the SetRequestHeader before you make the request like:
http.SetRequestHeader(“User-Agent:”, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/601.6.17 (KHTML, like Gecko) Version/9.1.1 Safari/601.6.17)
If that still doesnt work then it might be the http 1.0 vs 1.1 problem in which case you will have to use the new framework to make the request. which should work on most targets now I think:
Its very similar but sends a 1.1 request. You can also roll your own easily enough as long as you dont need to support any of the drastically more complicated encodings or something. Just to get data back isnt that hard with a raw socket and sending that list of headers.