fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

Delphi XE2 installation error #91

Open vtgustavo opened 7 years ago

vtgustavo commented 7 years ago

compiling packages Delphi xe2 error

function: procedure TMultiPartFormData.AddFieldContent(Field: TRttiField; var Content: TStringList); const FmtTextContent = 'Content-Disposition: form-data; name="%s"'+ sLineBreak+sLineBreak +'%s'; FmtFileContent = 'Content-Disposition: form-data; name="%s"; filename="%s"'+ sLineBreak +'Content-Type: %s'+ sLineBreak+sLineBreak+ '%s'; var Attachment: TMultiPartFormAttachment; begin if Field.FieldType.TypeKind in [tkString, tkUString, tkWChar, tkLString, tkWString, tkInteger, tkChar, tkWChar] then begin Content.Add(Format(FmtTextContent, [Field.Name, Field.GetValue(Self).AsString])); Exit; end;

if Field.FieldType.Name.Equals(TMultiPartFormAttachment.ClassName) then =>Error Here begin Attachment := Field.GetValue(Self).AsType; Content.Add(Format(FmtFileContent, [Field.Name, Attachment.FileName, Attachment.MimeType, Attachment.Content.DataString])); end; end;

[DCC Error] RestClient.pas(1076): E2018 Record, object or class type required

RobertoSchneiders commented 7 years ago

@vtgustavo thanks for reporting. Can you send a pull request to fix this?

ebraudio commented 3 years ago

//if Field.FieldType.Name.Equals(TMultiPartFormAttachment.ClassName)

if Field.FieldType.Name = TMultiPartFormAttachment.ClassName then