Additional type for HTTPInfo(): #PB_Http_Header

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Additional type for HTTPInfo(): #PB_Http_Header

Post by infratec »

Code: Select all

#PB_Http_Header
should return the complete http header.

Than we can extract what's needed to know.
Like Cookies.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by Lord »

infratec wrote:

Code: Select all

#PB_Http_Header
should return the complete http header.
...
This would be very helpfull.
Image
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by Fred »

Nice idea. I guess GetHTTPHeader() could be deprecated then if a new #PB_Http_HeaderOnly flag is added.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by infratec »

No,

Code: Select all

GetHTTPHeader()
is still needed.

Else you can not check how large a file is what you need to download before you download it.
Maybe you need to check if the file fits in your free memory before you download it.
That's only possible with GetHTTPHeader(), because it makes no real download.

Bernd
Fred
Administrator
Administrator
Posts: 16617
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by Fred »

That's why I added: "if a new #PB_Http_HeaderOnly flag is added." :)
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by kenmo »

+1000

Great request, I really hope this can be added for 5.71!

Right now I am resorting to curl.exe because I need access to Cookies / other headers returned from a server.
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by infratec »

You don't need curl.exe :mrgreen:

libcurl is included in PB. You can use libcurl.pbi (search) to implement what's needed.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Additional type for HTTPInfo(): #PB_Http_Header

Post by DoubleDutch »

+1 for this, I need it to use tinypng properly:

https://tinypng.com/developers/reference
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply