so I need to upload a file using synapse. I also need to add certain headers to my http post request.
It seems my brain has melted, I know about HttpPostFile, but I cant add headers to that method?
Basically, my question is (1) how to add headers to HttpPostFile method? or (2) is there a synapse way to simply add file upload to httpmethod method?
Sorry if its a silly question, its 3AM here, my brain has stopped working hours ago.
{$mode delphi}
uses sysutils, strutils, httpsend, classes, ssl_openssl, synautil;
var
http: thttpsend;
begin
http := thttpsend.create;
http.headers.add('SOME AUTH HEADER');
http.headers.add('ANOTHER AUTH HEADER');
http.headers.add('Content-Type: application/octet-string');
(* is there a way to simply "add file to upload" without manually editing http request? *)
http.free;
end.