Delphi调用Http接口上传文件


SS := TStringStream.Create('', TEncoding.UTF8);  
HttpClient := TIdHttp.Create();  
MutPartForm := TIdMultiPartFormDataStream.Create;  
try  
  MutPartForm.AddFormField('unitCode', UnitCode);  
  MutPartForm.AddFormField('regCode', RegCode);  
  MutPartForm.AddFile('data', 'data.zip', GetMIMETypeFromFile('data.zip'));  
  HttpClient.Post(Url, MutPartForm, SS);  
  response := SS.DataString;  
finally  
  SS.Free;  
  HttpClient.Free;  
  MutPartForm.Free;  
end;  

联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678