Features for the HTTP library

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Features for the HTTP library

Post by Joakim Christiansen »

Since I've created all these myself I don't really need them, but it would be handy for newbies:

GetHeaderValue("Content-Length") ;Extracts the value
SetUserAgent("Whatever you want to call it") ;Then used by ALL PB functions accessing the internet
HTTPPost(URL$,PostData$,@RecievingBuffer,BufferLength) ;Where post data is like value=blabla&value2=blabla

EDIT:

I would also like URLEncoder() to have a flag to encode single and double quotes.
Last edited by Joakim Christiansen on Tue Apr 29, 2008 6:52 pm, edited 1 time in total.
I like logic, hence I dislike humans but love computers.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

You know the Image-Button? :wink:

Go and add your ideas here:
http://www.purebasic.fr/english/viewtopic.php?t=30680 :idea:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hi Joakim Christiansen,

Good ideas.
But your definition of HTTPPost isn't very handy.
Postdatas could containing binary data like attachements.

I commend such like this....

AddHTTPPostData ( *Attachment , lAttachmentSize.l )
AddHTTPPostString ( sKey.s , sString.s )
SendHTTPPost( sURL.s , *receivingBuffer , lBufferSize.l )

Best regards

Wolf
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I would also like URLEncoder() to have a flag to encode single and double quotes too.
I like logic, hence I dislike humans but love computers.
Post Reply