-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[API Proposal]: Add multipart/related to MediaTypeNames.Multipart
#95446
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBackground and motivationThe The same should exist for API Proposalnamespace System.Net.Mime;
public static class MediaTypeNames
{
public static class Multipart
{
+ public const string Related = "multipart/related";
}
} API Usageusing Microsoft.AspNetCore.Http;
using System.Net.Mime;
void M(HttpRequest request)
{
Console.WriteLine(request.ContentType == MediaTypeNames.Multipart.Related)
} Alternative DesignsNo response RisksNo response
|
Triage: seems reasonable, but we might consider collecting more together and batch them as we did in #85807. |
Given this would only be introduced in .NET 9 anyway, I have no problem waiting for some more media types. |
Just discovered another one: namespace System.Net.Mime;
public static class MediaTypeNames
{
public static class Application
{
+ public const string Gzip = "application/gzip";
}
} |
What about |
Keep them incoming. But please also upvote the issue so that we can prioritize accordingly. |
@ManickaP Since the first preview of .NET 9 has been released and there has been no further activity, can we hand this over to API review? |
In relation to an issue I submitted today, there is also |
@dotnet/ncl Let's talk about this issue and #102194 in our next sync so we can push it through API review. |
namespace System.Net.Mime;
public static partial class MediaTypeNames
{
public static partial class Multipart
{
// see https://www.ietf.org/rfc/rfc2387.txt
public const string Related = "multipart/related";
// see https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
public const string Mixed = "multipart/mixed";
}
public static partial class Application
{
// https://datatracker.ietf.org/doc/html/rfc6713
public const string GZip = "application/gzip";
}
public static partial class Text
{
// see https://github.com/dotnet/runtime/issues/102194
public const string EventStream = "text/event-stream";
}
} |
Background and motivation
The
System.Net.Mime.MediaTypeNames.Multipart
type already contains a constant formultipart/form-data
which can be used by developers instead of introducing own constants at the risk of typos or duplication.The same should exist for
multipart/related
.API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: