Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-05

HTTP client/server components committed.

13 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

In the light of recent fppkg and fcl-web discussions:

I've committed simple HTTP server (threaded or not) and HTTP Client components to FCL-Web. They work using the fcl-net ssockets unit. (for which a fix has been committed as well). Both use blocking sockets.

The server component is integrated in the rest of fcl-web, the client is rather stand-alone.
Both are designed to be easily extensible.

There are examples of how to use both. The server example for instance allows files to be served and will properly report a 404 when a file is not found.

To do this, I committed a fpmimetypes unit to fcl-base, so the server can correctly determine the mime type of a file. It can read the contents of a mime.types file as found on unix.

if someone knows where this file can be found (or related information) on a Windows OS, please let me know.

This is an initial implementation. Known to-dos:
Client:
* Maybe add proxy support ?
* Easy access methods for POST/DELETE etc. commands. (currently only Get exists as a method, the rest can easily be done with HTTPMethod)

Server:
* Create a TWebHandler and THTTPWebApplication for use as a Lazarus project.

Comments and suggestions welcome. Please report bugs in the bugtracker.

Michael.

Reply by email

Žilvinas Ledas
to Michael Van Canneyt

Hi,
it's greate fpc has simple http client now ;)

Michael Van Canneyt wrote
if someone knows where this file can be found (or related information) on a Windows OS, please let me know.

You can look at components\turbopower_ipro\iputils.pas - it has handling for mime types. MSWindows ifdef has a good code for Windows OS (line 2751, function GetLocalContent(const TheFileName: string): string;).

Regards,
Zilvinas

Reply by email

Michael Van Canneyt
to Žilvinas Ledas
Žilvinas Ledas wrote 11 lines
Hi, it's greate fpc has simple http client now ;) On 2011-05-15 19:13, Michael Van Canneyt wrote: > > if someone knows where this file can be found (or related information) on a > Windows OS, please let me know. > You can look at components\turbopower_ipro\iputils.pas - it has handling for mime types. MSWindows ifdef has a good code for Windows OS (line 2751, function GetLocalContent(const TheFileName: string): string;).

Thank you, that is good advice; I will have a look at it :-)

Michael.

Reply by email

Michael Van Canneyt
to Inoussa OUEDRAOGO
Inoussa OUEDRAOGO wrote 7 lines
> I've committed simple HTTP server (threaded or not) and HTTP Client > components to FCL-Web. They work using the fcl-net ssockets unit. (for which > a fix has been committed as well). Both use blocking sockets. > Great news ! It should be now possible to develop a WST "web service" http server and/or client out of the box :-)

Exactly, I had thought about that as well :-)

Will you look at it, or would you like me to do it ?

Michael.

Reply by email

Inoussa OUEDRAOGO
to Michael Van Canneyt: Exactly, I had thought about that as well :-) Will you look at it, or would you like me…

2011/5/17 Michael Van Canneyt

Show quoted text 17 lines
On Tue, 17 May 2011, Inoussa OUEDRAOGO wrote: I've committed simple HTTP server (threaded or not) and HTTP Client >> components to FCL-Web. They work using the fcl-net ssockets unit. (for >> which >> a fix has been committed as well). Both use blocking sockets. >> >> > Great news ! It should be now possible to develop a WST "web service" http > server and/or client out of the box :-) > Exactly, I had thought about that as well :-) Will you look at it, or would you like me to do it ?

I would like you to look at it :-) as I am busy right now with cpstrnew.

Inoussa O.

Reply by email

Inoussa OUEDRAOGO
to Michael Schnell

2011/5/17 Michael Schnell

Show quoted text 8 lines
On 05/17/2011 01:19 PM, Inoussa OUEDRAOGO wrote: > I am busy right now with cpstrnew. > Yeah ! Great ! Can you say anything about the state of same ?

It is getting better. At least on WinXP/32 I can the fpc test suite, there are some failed tests, but not that much.
Check it out and test it by yourself. Tests (preferably validated with delphi) are welcome.

Inoussa O.

Reply by email

Michael Schnell
to Inoussa OUEDRAOGO
Inoussa OUEDRAOGO wrote 5 lines
It is getting better. At least on WinXP/32 I can the fpc test suite, there are some failed tests, but not that much. Check it out and test it by yourself. Tests (preferably validated with delphi) are welcome.

Sounds good. I frequently do check in the svn tree for it.

But this is an FPC not a Lazarus thingy. I'm not really sure how to install and use an independent frpc. But maybe I'll try tomorrow...

-Michael

Reply by email

Michael Van Canneyt
to Inoussa OUEDRAOGO: 2011/5/17 Michael Van Canneyt I would like you to look at it :-) as I am busy right now…
Inoussa OUEDRAOGO wrote 22 lines
2011/5/17 Michael Van Canneyt > > > On Tue, 17 May 2011, Inoussa OUEDRAOGO wrote: > > I've committed simple HTTP server (threaded or not) and HTTP Client >>> components to FCL-Web. They work using the fcl-net ssockets unit. (for >>> which >>> a fix has been committed as well). Both use blocking sockets. >>> >>> >> Great news ! It should be now possible to develop a WST "web service" http >> server and/or client out of the box :-) >> > > Exactly, I had thought about that as well :-) > > Will you look at it, or would you like me to do it ? I would like you to look at it :-) as I am busy right now with cpstrnew.

OK.

Michael.

Reply by email