Page 1 of 2

HTTP library 1.0 Beta

Posted: Sun Dec 12, 2004 4:15 pm
by Num3
I've rebuilt the GetURL lib, and renamed it.

These are the new functions:
  • HTTP_Init
    HTTP_LastError_Description
    HTTP_LastError_ID
    HTTP_New_Connection
    HTTP_Set_InBuffer
    HTTP_Get_InBuffer
    HTTP_Set_Proxy
    HTTP_Set_Authorization
    HTTP_File_Size
    HTTP_File_Date
    HTTP_Download_ToFile
    HTTP_Download_ToMem
    HTTP_Get_Progress
    HTTP_Stop
There's a basic example on this distro, but no helpfile for now.

Hope you all can test it for bugs!

The install os only 35k and you can get it
»»HERE««

Posted: Sun Dec 12, 2004 4:50 pm
by GPI
is it possible to get the source?
(Sorry, but i know your old lib)

Posted: Sun Dec 12, 2004 4:55 pm
by Num3
I was planing to release the source code with the final distro, but here's a link to the current beta source.

And thanks for the date parsing routine, i included it on my lib :wink:

http://cosmos.oninetspeed.pt/rui_carval ... source.zip

Posted: Sun Dec 12, 2004 6:39 pm
by Bonne_den_kule
Nice lib.
:D

Posted: Sun Dec 12, 2004 8:11 pm
by GPI
i found nearly all errors again in you lib:

1.WRONG:
Base64Encoder(conc$,Len(conc$),OutputBuffer,OutputBuffer*2)

Better:
Base64Encoder(conc$,Len(conc$),OutputBuffer,Len(conc$)*2)

2.And a proxy doesn't need always a password.

3.When a proxy is used, you *MUST* give the complete url in the uri
"GET http://gpihome.de/crillion/english.txt http/1.0"

4. Location in the "request"-header is unused. When you get a "moved" (3xx)-message you must set the "location"-part as new URL.

5. Why you ask first the size "HEAD" and the with "GET"?
With "Get" you get the full header.
The end of a header is definied with chr(13)+chr(10)+chr(13)+chr(10) and it is easy too detect. And when you use a proxy, your connection is disconnected after the head.

6. "Splitted" headers aren't supported. What is, when a header is too long for one "ReceiveNetworkData(internetID,@Content$,14500)" (i mean, when the server doN't send all at one time, because of a bad connection)?

7. ?!?

Code: Select all

Procedure HTTP_Set_Authorization(ConnectionID.l, Username.s,Password.s);Set Authentication Data
EndProcedure
8. CreateThread(@int_Action(),Str(ConnectionID)+"|"+Str(#HTTP_Action_Get2File))
Bad idea, when you use threads and strings.

9. Warning:
Procedure HTTP_Stop();Stops HTTP library
ClearList(http_data())
EndProcedure
You should free memory and break all created threads.

10. Wrong errorhandling:

Code: Select all

If FindString(Content$,"404",1)
the errorcode is in the first line of the Content. With you code it is possble, that a "Content-Length: 1404" is detected as error.

Posted: Sun Dec 12, 2004 10:24 pm
by bluejoke
Hi!

I would really enjoy to work with your new lib, if you could do that updates, GPI proposed.
I was really sorry that your old Lib didn't provide a possibility to download files with a variable Size,
so if it works now, I will try to use it.

thanks a lot,
Simon

Please excuse all my mistakes in the post :oops:,
I tried my best to write correct English

Posted: Mon Dec 13, 2004 5:35 pm
by GPI
>I was really sorry that your old Lib didn't provide a possibility to download
>files with a variable Size,
>so if it works now, I will try to use it.

What kind of download?

Posted: Mon Dec 13, 2004 5:55 pm
by Num3
He means when the server does not give the size of the file to be downloaded...
I'm working on the bug fixes and on that too ;)

Posted: Mon Dec 13, 2004 6:40 pm
by GPI
Num3 wrote:He means when the server does not give the size of the file to be downloaded...
Does somebody have a example?
(i manged partial get, and i think i have engouth information for the "unsize"-download).

..

Posted: Mon Dec 13, 2004 7:15 pm
by NoahPhense
Very kewl.. this lib/source has many applications..

thanks for keeping it alive..

- np

Posted: Mon Dec 13, 2004 9:46 pm
by GPI
examples for this downloadtype:

http://shinji.chaosnet.org/phpinfo.php
http://shinji.chaosnet.org/phpinfo.php? ... AA001ACF42

GPI
(btw: The server must send HTTP1.1! otherwise this will not work. I'm sorry, but i don't know, how to detect the serverdisconnect...)

Posted: Sat Dec 18, 2004 3:16 pm
by bluejoke
Num3 is right:
does it work if the server doesn't tell you the size?
I think, it happens for example when the server sends you the output of an PHP-Script

The Script of freak is able to do it, but I don't get it running, so I hope you'll feature it soon, because your solution is much easier to understand than the COM-Object one of freak

sry for my bad english

Simon

Posted: Sat Dec 18, 2004 5:01 pm
by GPI

Posted: Wed Apr 13, 2005 10:36 pm
by DoubleDutch
Num3: Any news about your http library?

-Anthony

Posted: Thu May 05, 2005 8:49 pm
by Progi1984
What are the nws about this intersting library ?