Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to send WebKitFormBoundary in multipart
#2
(08-03-2021, 04:58 PM)alpires2000 Wrote: Exist some way to send WebKitFormBoundary with MultiPartFormDataStream?

Not officially, but you could derive a new class from TIdMultipartFormDataStream in order to access its protected FBoundary and FRequestContentType members, and then you can set them to whatever you want. But, why do you think you need to customize the MIME boundary to use a WebKit format? TIdMultipartFormDataStream generates its own random MIME boundary (in '--------mmddyyhhnnsszzz' format), which should be perfectly fine as-is since the actual boundary used is included in the transmitted Content-Type HTTP header, and any conformant webserver will respect that boundary. So there is no good reason to change it.

(08-03-2021, 04:58 PM)alpires2000 Wrote: idhttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;

FYI, that line is not needed, as the TIdMultipartFormDataStream overload of TIdHTTP.Post() will handle that assignment internally for you.

(08-03-2021, 04:58 PM)alpires2000 Wrote: MultiPartFormDataStream.Position := 0;

That line is not necessary, either.

Reply


Messages In This Thread
RE: How to send WebKitFormBoundary in multipart - by rlebeau - 08-03-2021, 05:23 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)