IDHttp.post获取不到数据
procedure TForm1.Button1Click(Sender: TObject);
var
sStr:string;
sStrs:TStringList;
//sPostData:TStringStream;
begin
try
FHttp.HandleRedirects:=True;//Idhttp
FHttp.Request.CustomHeaders.Clear;
FHttp.Request.ContentType:='application/json';
FHttp.Request.CustomHeaders.Add('ClientId=com.primeton.esb.consumer.mis');
FHttp.Request.CustomHeaders.Add('OperationCode=esb.nrec.ecm.edoc.file.search');
FHttp.Request.CustomHeaders.Add('EmpNo=nrmes');
sStrs:=TStringList.Create();
sStrs.Add('{"data":{"folderid":"4398071","filename":"HAMUX08F"}}');
try
sStr:=FHttp.post('https://esb.nrec.com:9680/esb.nrec.ecm.edoc.file',sStrs);
showmessage(sStr);
except
on e:exception do
begin
showmessage(e.message);
end;
end;
finally
freeandnil(sStrs);
end;
end;
我使用postman是可以获取到数据的。