码迷,mamicode.com
首页 > 其他好文 > 详细

mormot2 MultiPartFormData

时间:2020-11-24 12:24:49      阅读:7      评论:0      收藏:0      [点我收藏+]

标签:form   class   boolean   OWIN   ret   orm   tip   rate   content   

mormot2 MultiPartFormData

1)MultiPartFormData 

单元文件mormot.core.buffers.pas

TMultiPart = record

TMultiPartDynArray = array of TMultiPart;

/// decode multipart/form-data POST request content
// - following RFC1867
function MultiPartFormDataDecode(const MimeType,Body: RawUTF8;
var MultiPart: TMultiPartDynArray): boolean;

/// encode multipart fields and files
// - only one of them can be used because MultiPartFormDataDecode must implement
// both decodings
// - MultiPart: parts to build the multipart content from, which may be created
// using MultiPartFormDataAddFile/MultiPartFormDataAddField
// - MultiPartContentType: variable returning
// $ Content-Type: multipart/form-data; boundary=xxx
// where xxx is the first generated boundary
// - MultiPartContent: generated multipart content
function MultiPartFormDataEncode(const MultiPart: TMultiPartDynArray;
var MultiPartContentType, MultiPartContent: RawUTF8): boolean;

/// encode a file in a multipart array
// - FileName: file to encode
// - Multipart: where the part is added
// - Name: name of the part, is empty the name ‘File###‘ is generated
function MultiPartFormDataAddFile(const FileName: TFileName;
var MultiPart: TMultiPartDynArray; const Name: RawUTF8 = ‘‘): boolean;

/// encode a field in a multipart array
// - FieldName: field name of the part
// - FieldValue: value of the field
// - Multipart: where the part is added
function MultiPartFormDataAddField(const FieldName, FieldValue: RawUTF8;
var MultiPart: TMultiPartDynArray): boolean;

  

mormot2 MultiPartFormData

标签:form   class   boolean   OWIN   ret   orm   tip   rate   content   

原文地址:https://www.cnblogs.com/hnxxcxg/p/14009139.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!