You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been fiddling with your library pretty much lately, as you probably know. I still haven't figured out how to serialise a MimeEntity without its headers though. There's the "WriteTo" method, which dumps the entire entity to whatever stream I supply. But I'd love to be able to serialise an entity without its headers.
The reason why I am asking, is because I have this logic where I send a MimeEntity over en HTTP WebResponse, as the result of a WebService, where I'd normally want to put the headers for the root entity inside of the response HTTP headers, and not have them being part of content sent. I could use "WriteTo" and serialise also the headers, but I am pretty certain that I'd be breaking several known internet standards if I do.
So basically, I'd like to pass the headers of the root entity over on the HTTP response header collection, and then only serialise the "content" of the root entity.
Now there are several other use-cases for the same feature, such as having an HTML form object with enctype of "multipart/form-data", where the headers of the root multipart would be sent in the request header collection, and not being part of actual content passed. So I am pretty certain I am not (completely) alone in wanting this feature.
What I'd imagine, is that this could probably be quite easy with another enum value for the "FormatOptions" enum. Alternatively an overload of WriteTo or an additional method that only sends the MimeEntity's content.
The only viable route today, without adding features in MimeKit, seems to be traversing the entity myself, using the "ContentObject", which would create literally hundreds of lines of code for me, and others in the same position. While I am imagining it's a "one liner" inside of MimeEntity's WriteTo method ...?
Notice, I don't know which type my MimeEntity is, it can be Multipart, MimePart, MultipartSigned, etc, etc, etc ...
I simply want an overload (or tips as to how to solve it myself) for serialising the entity without its headers ...
Thx,
.t
The text was updated successfully, but these errors were encountered:
polterguy
changed the title
Serialising MimeEntity without headers
Feature Request - Serialising MimeEntity without headers
Dec 12, 2015
BTW, sinde there is already an overload of "MimeEntity.Load" taking ContentType parameter, for the other side of the equation, it seems as if it's "almost there". Only missing that tiny little detail from above ... ;)
Howdy Jeff,
I've been fiddling with your library pretty much lately, as you probably know. I still haven't figured out how to serialise a MimeEntity without its headers though. There's the "WriteTo" method, which dumps the entire entity to whatever stream I supply. But I'd love to be able to serialise an entity without its headers.
The reason why I am asking, is because I have this logic where I send a MimeEntity over en HTTP WebResponse, as the result of a WebService, where I'd normally want to put the headers for the root entity inside of the response HTTP headers, and not have them being part of content sent. I could use "WriteTo" and serialise also the headers, but I am pretty certain that I'd be breaking several known internet standards if I do.
So basically, I'd like to pass the headers of the root entity over on the HTTP response header collection, and then only serialise the "content" of the root entity.
Now there are several other use-cases for the same feature, such as having an HTML form object with enctype of "multipart/form-data", where the headers of the root multipart would be sent in the request header collection, and not being part of actual content passed. So I am pretty certain I am not (completely) alone in wanting this feature.
What I'd imagine, is that this could probably be quite easy with another enum value for the "FormatOptions" enum. Alternatively an overload of WriteTo or an additional method that only sends the MimeEntity's content.
The only viable route today, without adding features in MimeKit, seems to be traversing the entity myself, using the "ContentObject", which would create literally hundreds of lines of code for me, and others in the same position. While I am imagining it's a "one liner" inside of MimeEntity's WriteTo method ...?
Notice, I don't know which type my MimeEntity is, it can be Multipart, MimePart, MultipartSigned, etc, etc, etc ...
I simply want an overload (or tips as to how to solve it myself) for serialising the entity without its headers ...
Thx,
.t
The text was updated successfully, but these errors were encountered: