Improved HTTP features

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Xanos
User
User
Posts: 45
Joined: Sat Feb 28, 2015 1:20 pm

Improved HTTP features

Post 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
Last edited by Xanos on Fri Aug 31, 2018 11:52 pm, edited 5 times in total.
Programming on Windows 10 Pro / Windows 7 Enterprise / Linux Mint 19 / Manjaro Linux with PB 5, Python 3 and Go
User avatar
Mijikai
Addict
Addict
Posts: 1517
Joined: Sun Sep 11, 2016 2:17 pm

Re: Improved HTTP features

Post by Mijikai »

+1

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