1,594
社区成员




//也可以用com来发
function TForm1.GetData(url:string): string;
var
responseText: WideString;
xmlHttp: oleVariant;
begin
Result:='';
try
xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
xmlHttp.open('POST',url,false);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send('ePayAccountNum=XXX&password=XXX&transactionCode=XXX&orderNum=IVC00544&transactionAmount=10.00&cardAccountNum=XXX&expirationDate=0108&testTransaction=Y');
responseText:=xmlHttp.responseText;
if xmlHttp.status='200' then
begin
Result:=responseText;
end;
xmlHttp := Unassigned;
except
Result:='';
end;
end;
var
strResponse : string;
datastream: TIdMultiPartFormDataStream;
begin
datastream:= TIdMultiPartFormDataStream.Create;
datastream.AddFormField(’UserID’, EdtUser.text);
strResponse:=IdHTTP1.Post(URL.Text, data);
datastream.Free;
end;