File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,26 @@ begin
157
157
> ** NOTE:** Async request is only supported for ` WinHTTP ` .
158
158
> Any thought about how to implement this feature for ` Indy ` and ` WinInet ` are welcome.
159
159
160
+ - ** MULTIPART/FORM-DATA**
161
+
162
+ Send forms with file attachments is possible by declaring a class that represents the form fields and inherits from ` TMultiPartFormData ` .
163
+
164
+ ``` Delphi
165
+ TRequestData = class(TMultiPartFormData)
166
+ name: string;
167
+ ticket_number: integer;
168
+ signed_contract: TMultiPartFormAttachment;
169
+ end;
170
+ ```
171
+ ``` Delphi
172
+ Request := TRequestData.Create;
173
+ Request.name := 'Fernando';
174
+ Request.ticket_number := 123;
175
+ Request.signed_contract := TMultiPartFormAttachment.Create('c:\contract.txt', 'text/plain', 'contract.txt');
176
+
177
+ Result := RestClient.Resource(URL).Post(Request);
178
+ ```
179
+
160
180
## Authentication
161
181
162
182
RestClient supports HTTP Basic authentication. You can set credentials using the ` SetCredentials ` method before making the first request:
You can’t perform that action at this time.
0 commit comments