[Implemented] Result$ = GetHTTPFile(URL$)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Wolf
Enthusiast
Enthusiast
Posts: 232
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

[Implemented] Result$ = GetHTTPFile(URL$)

Post by Wolf »

Existing PB ReceiveHTTPFile() is very useful but if we want parse downloaded file before writed to disk isn't possible. Now We must download file using ReceiveHTTPFile() , read whole file, parse it and then write it again to disk.
Something like Result$ = GetHTTPFile(URL$) or Result$ = ReceiveHTTPFileToMemory(URL$) is very useful in PureBasic Http commands.

Thanks
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Result$ = GetHTTPFile(URL$)

Post by STARGÅTE »

+1

For general files, it would be better to load into a memory buffer and not into a String as Return,
because the file can be binary and may contain zeros so that would cut the string!

So, for Text-Files:
String.s = ReceiveHTTPString(URL.s)
My code here

for Binary-Files:
*Memory = ReceiveHTTPData(URL.s)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

Re: Result$ = GetHTTPFile(URL$)

Post by Fredi »

+1

I think something like this String.s = ReceiveHTTPString(URL.s) or this *Memory = ReceiveHTTPData(URL.s) is more useful of existing ReceiveHTTPFile() command.
Wolf
Enthusiast
Enthusiast
Posts: 232
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Re: Result$ = GetHTTPFile(URL$)

Post by Wolf »

STARGÅTE wrote:+1

So, for Text-Files:
String.s = ReceiveHTTPString(URL.s)

for Binary-Files:
*Memory = ReceiveHTTPData(URL.s)
I'm agree with you, now is very better for string and binary files.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Result$ = GetHTTPFile(URL$)

Post by DoubleDutch »

+1, but I also think that the built-in http, mail and ftp libraries also need automatic and programmable proxy support - maybe a new library called 'proxy' to sort out these things for future commands?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Primus1
User
User
Posts: 17
Joined: Wed Jan 12, 2011 2:48 pm
Contact:

Re: Result$ = GetHTTPFile(URL$)

Post by Primus1 »

Yes, please add this along with:

- cookie support
- easy posting of variables to URL's using POST or GET
A sketch tool with a twist, SECret INSPiration made using Purebasic.
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

Re: Result$ = GetHTTPFile(URL$)

Post by Fredi »

Not any news in PB 4.60? Fred?
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

Re: Result$ = GetHTTPFile(URL$)

Post by uwekel »

+1

I know this thread is old, but the request is still not implemented and it would be very helpful.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
User avatar
majikeyric
Enthusiast
Enthusiast
Posts: 187
Joined: Mon Oct 21, 2013 5:21 pm
Location: France
Contact:

Re: Result$ = GetHTTPFile(URL$)

Post by majikeyric »

+1 :mrgreen:
Post Reply