I really like, that PB has decent support for retrieving data over HTTP(S). However, I think that this support could greatly be expanded.
- First of all, there still seem to be some issues:
- Async Downloads cause IMA: Async HTTP Download and Catching Images
- Async also has problems on Mac: Broken async http procedures?
- I sometimes have problems retrieving HTTPS content that is certified by Let's Encrypt on Windows - The download just fails. After accessing the domain with IE, the download it also works in PB
- Now my request for new features:
- Add connection timeout: OpenNetworkConnection has it, why is it not available for HTTP?
- Get more error information: If download fails, what was the problem? Connection timeout, transmission was cancelled, connection closed by server, etc...
- Get header information when retrieving content: The function GetHTTPHeader is nice to have, but why does requesting the header require an individual HTTP HEAD request? The header contains important information for every transmission, but cannot be accessed when retrieving content. Please add the possibility to also get the header during a "normal" RceiveHTTPFile/ReceiveHTTPMemory call. Also, separate HEAD and GET requests are not supported by all dynamically build websites, of which there are quite a few nowadays
- optionally: parse the header. This is very simple and I obviously implemented this for myself already, so I do not really need this. But it would be nice for beginners to have direct access to "HTTP status code", "content length", etc...
On a side-note: A shoutout to all purebasic users that work with HTTP(S) a lot. Do you use the internal commands or do you have a good 3rd party crossplattform HTTPS alternative? In the past, I did most stuff with raw network connections but with HTTPS the SSL has to be put on top... I think about taking a look at this SSL lib for PB...
Maybe the function can be improved in the same way that also HTTP/2 support can be made available: viewtopic.php?f=3&t=70714