现有一段程序实现delphi在本地读取xml文件,发给远程主机部署的servlet,现在servlet接口改变,它不再接受xml文件而改成接受参数,delphi端该如何修改?用原来的xmlhttp.send方法可以传参数吗?
部分程序如下:
iFileID := FileOpen(sAppPath + 'CODX\mod_cx.xml', fmOpenRead or fmShareDenyWrite);
FileRead(iFileID, pcBuf, 65535);
sXMLBuf := pcBuf;
FileClose(iFileID);
sXMLBuf := StringReplace(sXMLBuf, 'dhsb_JYLSH', sLsh, trfFlags);
iFileID := FileCreate(sAppPath + 'CODX\new_cx.xml');
StrPCopy(pcBuf, sXMLBuf);
FileWrite(iFileID, pcBuf, Length(sXMLBuf));
FileClose(iFileID);try
CoInitialize(nil);
XMLHttp := CreateOleObject('Microsoft.XMLHTTP');
except
begin
CoUninitialize();
Exit;
end;
end;XMLHttp.Open('POST', 'http://' + sJhpt_ip + '/SelCodxServlet', False);
try
XMLHttp.Send(string(StringToOleStr(sXMLBuf)));
except
begin
XMLHttp := Unassigned;
CoUninitialize();
Exit;