[twsocket] Help - THttpServer and PUT
Hi, i test the ics komponent and creating RESTful service, but have problem with implementing unimplemented request PUT. I handled PUT and DELETE in the OnUnknownRequest, bud where is data sending by client via PUT method? Any samples or documentation? I thank all Best regards, Kamil. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Help - THttpServer and PUT
Kamil Pavel Skála wrote: Hi, i test the ics komponent and creating RESTful service, but have problem with implementing unimplemented request PUT. I handled PUT and DELETE in the OnUnknownRequest, bud where is data sending by client via PUT method? Any samples or documentation? PUT method is very similar to POST http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html The OverbyteIcsWebServ demo shows how to handle POST requests. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Help - THttpServer and PUT
Arno Garrels wrote: Kamil Pavel Skála wrote: Hi, i test the ics komponent and creating RESTful service, but have problem with implementing unimplemented request PUT. I handled PUT and DELETE in the OnUnknownRequest, bud where is data sending by client via PUT method? Any samples or documentation? PUT method is very similar to POST http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html The OverbyteIcsWebServ demo shows how to handle POST requests. It's likely most simple to just override THttpConnection.TriggerUnknownRequestMethod and then handle PUT requests in the OnPostDocument and OnPostedData events as well. {code} procedure TMyHttpConnection.TriggerUnknownRequestMethod(var Handled: Boolean); begin if Method = 'PUT' then begin ProcessPost; Handled := True; end else inherited; end; {code} -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] [HELP] THttpServer
do i have to do like : ClientCnx.AnswerStream(correctparameters); ClientCnx.Docstream:=ResultStream; ClientCnx.SendStream; Forget anbout the two last lines ! Have a look at THttpConnection.AnswerStream and you'll understand. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Guillaume MAISON [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Tuesday, April 11, 2006 6:21 PM Subject: [twsocket] [HELP] THttpServer Hi guys, i must be blind at this time but i don't know how to send back the content of a stream. i explain : i receive a http request with posted data. everything runs fine, i can have the posted content and analyze it, process it and then at the stage of returning the resulting stream... i don't know how to do it... do i have to do like : ClientCnx.AnswerStream(correctparameters); ClientCnx.Docstream:=ResultStream; ClientCnx.SendStream; thanks in advance for your help ! -- Guillaume MAISON eXpress Network Agen - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : +33 5 53 87 91 48 Mobile : +33 6 30 14 91 23 Fax : +33 5 53 68 73 50 e-mail : [EMAIL PROTECTED] Web : http://nauteus.com Mon Profil sur Viaduc: http://www.viaduc.com/public/profil/?memberId=0021oz963uuea795 Vous inscrire sur Viaduc : http://www.viaduc.com/invitationpersonnelle/0021oz963uuea795 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] [HELP] THttpServer
Francois PIETTE a écrit : do i have to do like : ClientCnx.AnswerStream(correctparameters); ClientCnx.Docstream:=ResultStream; ClientCnx.SendStream; Forget anbout the two last lines ! Have a look at THttpConnection.AnswerStream and you'll understand. Yop ! it works ! Thanks a lot François ! regards, -- Guillaume MAISON eXpress Network Agen - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : +33 5 53 87 91 48 Mobile : +33 6 30 14 91 23 Fax : +33 5 53 68 73 50 e-mail : [EMAIL PROTECTED] Web : http://nauteus.com Mon Profil sur Viaduc: http://www.viaduc.com/public/profil/?memberId=0021oz963uuea795 Vous inscrire sur Viaduc : http://www.viaduc.com/invitationpersonnelle/0021oz963uuea795 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] [HELP] THttpServer
do i have to do like : ClientCnx.AnswerStream(correctparameters); ClientCnx.Docstream:=ResultStream; ClientCnx.SendStream; Forget anbout the two last lines ! Have a look at THttpConnection.AnswerStream and you'll understand. Yop ! it works ! Thanks a lot François ! I don't know your application, but maybe the template feature would be interesting for you. It is very powerful. For a demo, see TWebServForm.CreateVirtualDocument_Template. The principle is simple: you prvide a HTML template with special tags. Those tags are replaced by values computed by your program. This way you can separate presentation (the HTML) from the code which produce data values. Very powerful and easy to use. -- [EMAIL PROTECTED] http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] [HELP] THttpServer
Francois PIETTE a écrit : Yop ! it works ! Thanks a lot François ! I don't know your application, but maybe the template feature would be interesting for you. It is very powerful. For a demo, see TWebServForm.CreateVirtualDocument_Template. The principle is simple: you prvide a HTML template with special tags. Those tags are replaced by values computed by your program. This way you can separate presentation (the HTML) from the code which produce data values. Very powerful and easy to use. The thing is that i'm not using the webserver as a HTML provider but much more like a HTTP provider. I'm sending and getting back XML files using a http server. i needed a convenient way to do the following : the client part of my application needs to send xml request. Some requests are sent through the internet to a PHP/MySQL http server that sends back a xml result. The thing is that this application might be run also in a standalone mode. that's why, instead of having several client interface, i have added to the client application a small http server that is used to handle all the requests... much easier way to proceed :) but thanks for the hint ! -- Guillaume MAISON eXpress Network Agen - [EMAIL PROTECTED] 83, Cours Victor Hugo 47000 AGEN Tél : +33 5 53 87 91 48 Mobile : +33 6 30 14 91 23 Fax : +33 5 53 68 73 50 e-mail : [EMAIL PROTECTED] Web : http://nauteus.com Mon Profil sur Viaduc: http://www.viaduc.com/public/profil/?memberId=0021oz963uuea795 Vous inscrire sur Viaduc : http://www.viaduc.com/invitationpersonnelle/0021oz963uuea795 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be