Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for user-defined MIME headers in TIdMultipartFormDataStream #172

Open
rlebeau opened this issue Apr 26, 2017 · 2 comments
Open
Labels
Element: MIME multipart/form-data Issues related to handling of MIME 'multipart/form-data' media type Status: Deferred Issue to be re-reviewed in a future release Type: Enhancement Issue is proposing a new feature/enhancement
Milestone

Comments

@rlebeau
Copy link
Member

rlebeau commented Apr 26, 2017

Add a headers property to TIdFormDataField (similar to TIdMessage.CustomHeaders and TIdMessagePart.Headers) so users can customize the MIME headers. For example, some servers may support a Content-MD5 header when uploading files.

@rlebeau rlebeau added Type: Enhancement Issue is proposing a new feature/enhancement Element: MIME multipart/form-data Issues related to handling of MIME 'multipart/form-data' media type labels Apr 26, 2017
@rlebeau rlebeau added this to the Indy 12 milestone Apr 26, 2017
@icegood
Copy link

icegood commented May 4, 2017

rlebeau, tnx. You created it as a result of our convesation. But there is a workaround for now. It works fine for me:

AmyHTTP.Request.CustomHeaders.Add('Expect: 100-continue');
AmyHTTP.Request.CustomHeaders.Add(Format('Content-MD5: %s', [AMD5Header]));
AmyHTTP.Post(AUrl, AMultiPartFormData);

as it seems that AMultiPartFormData headers just added to headers of request and merged with AmyHTTP.Request.CustomHeaders.

@rlebeau
Copy link
Member Author

rlebeau commented May 4, 2017

That applies the Content-MD5 header to the entire HTTP request body as a whole, not to any specific MIME field. When sending MIME data, the Content-MD5 header should be applied to the particular MIME field(s) that are actually being hashed.

@rlebeau rlebeau added the Status: Deferred Issue to be re-reviewed in a future release label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Element: MIME multipart/form-data Issues related to handling of MIME 'multipart/form-data' media type Status: Deferred Issue to be re-reviewed in a future release Type: Enhancement Issue is proposing a new feature/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants