Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pekkah/mimedb
MimeType utility generated from mime-db
https://github.com/pekkah/mimedb
asp-net asp-net-core dotnet dotnet-core http mime-types
Last synced: about 2 months ago
JSON representation
MimeType utility generated from mime-db
- Host: GitHub
- URL: https://github.com/pekkah/mimedb
- Owner: pekkah
- License: mit
- Created: 2020-04-22T14:12:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T17:31:04.000Z (8 months ago)
- Last Synced: 2024-05-13T17:52:13.188Z (8 months ago)
- Topics: asp-net, asp-net-core, dotnet, dotnet-core, http, mime-types
- Language: C#
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Mime type db
=============* Provides methods to get mime-type from extension
* DB is generated from [mime-db](https://github.com/jshttp/mime-db)Usage
-------------```csharp
[Theory]
[InlineData("json", "application/json")]
[InlineData("md", "text/markdown")]
public void TryGet(string extension, string mimeType)
{
/* Given */
/* When */
var found = MimeType.TryGet(extension, out var actual);/* Then */
Assert.True(found);
Assert.Equal(mimeType, actual.Type);
}
```> NOTE: Extension can start with '.'
Contribution
-------------To add new mime type please make PR at [mime-db](https://github.com/jshttp/mime-db).