[fpc-pascal] TFPHTTPClient Post works with jetty, fails with tomcat

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Feb 7 02:00:42 CET 2012


On Tue, 7 Feb 2012 01:47:52 +0100
Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:

> On Mon, 19 Dec 2011 10:39:09 +0100 (CET)
> michael.vancanneyt at wisa.be wrote:
> 
> >[...]
> > What does 'strace' say ?
> 
> Same happens on fpc wiki:

uses Classes, SysUtils, fphttpclient;
...
var
  Response: TStringStream;
  client: TFPHTTPClient;
  URL: String;
begin
  Response:=nil;
  client:=nil;
  try
    client:=TFPHTTPClient.Create(nil);
    Response:=TStringStream.Create('');
    URL:='http://wiki.freepascal.org/index.php?title=Special:Export&pages=Lazarus_Documentation'&curonly=1&action=submit';
    writeln('URL=',URL);
    client.Get(URL,Response);
    //writeln(Response.DataString);
  finally
    client.Free;
    Response.Free;
  end;
end;

 
> Here is the strace:
> 
> sendto(3, "GET /index.php?title=Special:Exp"..., 135, 0, NULL, 0) = 135
> recvfrom(3, "HTTP/1.1 200 OK\r\nDate: Tue, 07 F"..., 4096, 0, NULL, NULL) = 2880
> recvfrom(3, " and create spreadsheets, text d"..., 4096, 0, NULL, NULL) = 1440
> recvfrom(3, "interface to various hardware de"..., 4096, 0, NULL, NULL) = 2880
> recvfrom(3, "lements and links to the referen"..., 4096, 0, NULL, NULL) = 1440
> recvfrom(3, "eploying Your Application]] - Ho"..., 4096, 0, NULL, NULL) = 2880
> recvfrom(3, "zarus GUI\n*[[Roadmap]] - An idea"..., 4096, 0, NULL, NULL) = 1440
> recvfrom(3, " A few notes for programmers on "..., 4096, 0, NULL, NULL) = 1440
> recvfrom(3, "s Component]] for more component"..., 4096, 0, NULL, NULL) = 1440
> recvfrom(3, "blogspot.com/ Porting to Lazarus"..., 4096, 0, NULL, NULL) = 2061
> recvfrom(3, "17\r\n  </page>\n</mediawiki>\n\r\n0\r\n"..., 4096, 0, NULL, NULL) = 34
> recvfrom(3,
> 
> After some time it continues:
> 
> "", 4096, 0, NULL, NULL)    = 0
> close(3)                                = 0
> munmap(0x7f1daa4d1000, 262144)          = 0
> munmap(0x7f1daa52d000, 32768)           = 0
> munmap(0x7f1daa51d000, 32768)           = 0
> munmap(0x7f1daa4c9000, 32768)           = 0
> munmap(0x7f1daa4b9000, 32768)           = 0
> munmap(0x7f1daa4b1000, 32768)           = 0
> munmap(0x7f1daa4c1000, 32768)           = 0
> exit_group(0)                           = ?
 
Mattias



More information about the fpc-pascal mailing list