本文整理自网络,侵删。
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;
相关阅读 >>
Delphi windows 编程[11] - wm_size 消息
Delphi tmsweb core webhttprequest1提交json数据
Delphi出现 no mapping for the unicode character exists in the target multi-byte code page 处理方法
更多相关阅读请进入《Delphi》频道 >>