我正在使用 indys idhttp 提交 URL(帖子)
Procedure submit_post(url_string,EncodedStr:string;amemo:TMemo);
var
aStream: TMemoryStream;
Params: TStringStream;
begin
aStream := TMemoryStream.create;
Params := TStringStream.create('');
try
with Fmain.IdHTTP1 do
begin
Params.WriteString(EncodedStr);
Request.ContentType := 'application/x-www-form-urlencoded';
Request.Charset := 'utf-8';
try
Response.KeepAlive := False;
Post(url_string, params, aStream);
except
on E: Exception do
begin
Screen.Cursor := crDefault;
exit;
end;
end;
end;
aStream.WriteBuffer(#0' ', 1);
aStream.Position := 0;
amemo.Lines.LoadFromStream(aStream);
Screen.Cursor := crDefault;
finally
aStream.Free;
Params.Free;
end;
end;
它对我来说就像一个魅力。我正在尝试提交一个包含 300 个字符的参数的 URL(帖子),但会通过每 90 个字符添加一个“&”来自动拆分。所以服务器只接收 90 个字符而不是 300 个字符。
如果没有这种自动分隔,我如何提交一个包含 300 个字符参数的 URL?