Page 1 of 1

[Implemented] Result$ = GetHTTPFile(URL$)

Posted: Sat Jan 08, 2011 5:20 pm
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

Re: Result$ = GetHTTPFile(URL$)

Posted: Sat Jan 08, 2011 6:07 pm
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)

Re: Result$ = GetHTTPFile(URL$)

Posted: Sat Jan 08, 2011 6:53 pm
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.

Re: Result$ = GetHTTPFile(URL$)

Posted: Sat Jan 08, 2011 6:59 pm
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.

Re: Result$ = GetHTTPFile(URL$)

Posted: Sat Jan 08, 2011 9:45 pm
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?

Re: Result$ = GetHTTPFile(URL$)

Posted: Wed Jan 12, 2011 3:38 pm
by Primus1
Yes, please add this along with:

- cookie support
- easy posting of variables to URL's using POST or GET

Re: Result$ = GetHTTPFile(URL$)

Posted: Mon Jul 04, 2011 1:45 pm
by Fredi
Not any news in PB 4.60? Fred?

Re: Result$ = GetHTTPFile(URL$)

Posted: Tue May 12, 2015 6:40 pm
by uwekel
+1

I know this thread is old, but the request is still not implemented and it would be very helpful.

Re: Result$ = GetHTTPFile(URL$)

Posted: Tue May 12, 2015 7:38 pm
by majikeyric
+1 :mrgreen: