Page 1 of 1

Improved HTTP features

Posted: Fri Aug 31, 2018 9:00 am
by Xanos
Hello,
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:
  • 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...
Generally, I would like the Async HTTP downloads being implemented with an event-based system. E.g. like window rvents and also network events, but I guess this is personal preference...

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

Re: Improved HTTP features

Posted: Fri Aug 31, 2018 9:29 am
by Mijikai
+1

I use winapi because i had trouble with downloading and https.