有一个问题请教大家,我用indy10.5.8:idhttpserver想接收applicationjson的数据,是从android 发送的数据,但是数据非常大,idhttpserver 收不到是什么原因?delphi7的原版INDY是可以收到数据的,不过收不全.,所以升级了INDY10,但是问题好像更严重了,一点也收不到了.
是有什么地方设置不对么?还是什么原因?
use indy10 idhttpserver recv android sendto PC applicationjson data but jpg in json ,large data ,i have not recv the data .every string is empty,please help
if config wrong ?
code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,IdContext, StdCtrls, IdBaseComponent, IdComponent, IdCustomTCPServer,
IdCustomHTTPServer, IdHTTPServer;
type
TForm1 = class(TForm)
IdHTTPServer1: TIdHTTPServer;
Memo1: TMemo;
procedure IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
post_data:string;
begin
AContext.Connection.IOHandler.MaxLineLength:=-1;
Memo1.Lines.Add('ARequestInfo.Document:='+ARequestInfo.Document);
Memo1.Lines.Add('ARequestInfo.RawHTTPCommand:='+ARequestInfo.RawHTTPCommand);
Memo1.Lines.Add('ARequestInfo.Version:='+ARequestInfo.Version);
Memo1.Lines.Add('ARequestInfo.QueryParams:='+ARequestInfo.QueryParams);
Memo1.Lines.Add('ARequestInfo.Command:='+ARequestInfo.Command);
Memo1.Lines.Add('ARequestInfo.UnparsedParams:='+ARequestInfo.UnparsedParams);
Memo1.Lines.Add('ARequestInfo.FormParams:='+ARequestInfo.FormParams);
if Arequestinfo.command = 'post' then
try
post_data := Arequestinfo.params.gettext;
try
if(post_data<>'')then
begin
savefile(post_data,inttostr(v_suc_num+1)+.txt);
if memo1.lines.count>300 then
memo1.lines.clear;
memo1.lines.add(post_data);
end;
except on e: exception do
begin
Aresponseinfo.responseno := 500;
Aresponseinfo.contenttext := post_data;
Aresponseinfo.contentlength := length(post_data);
exit;
end;
end;
finally
end;
end;
end.
thanks for all friend
2022.8.19