mormot2 MultiPartFormData
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;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/14009139.html