-
Notifications
You must be signed in to change notification settings - Fork 14
MIMEType
Josh Wright edited this page Jan 14, 2021
·
4 revisions
An HTTP Media Type. It has a value: String appropriate for
putting into Content-Type headers.
public struct MIMETypeCreate with a string.
public init(_ value: String)- value: The string of the MIME type.
Creates based off of a known file extension that can be mapped
to an appropriate Content-Type header value. Returns nil if
no MIME type is known.
public init?(fileExtension: String)The . in front of the file extension is optional.
Usage:
let mt = MediaType(fileExtension: "html")!
print(mt.value) // "text/html"- fileExtension: The file extension to look up a MIME type for.
The value of this MIME type, appropriate for Content-Type
headers.
var value: Stringlet bmplet csslet csvlet epublet gziplet giflet htmllet calendarlet jpeglet javascriptlet jsonlet midlet mp3let mpeglet octetStreamlet ogalet ogvlet otflet pdflet phplet plainTextlet pnglet rtflet svglet tarlet tifflet ttflet wavlet xhtmllet xmllet zipGenerated at 2021-01-13T22:24:59-0800 using swift-doc 1.0.0-beta.5.
Alchemy
Types
- AlterTableBuilder
- BCryptDigest
- BasicAuthMiddleware
- BcryptError
- BelongsToRelationship
- CORSMiddleware
- CORSMiddleware.AllowOriginSetting
- CORSMiddleware.Configuration
- ColumnType
- CreateColumn
- CreateColumnBuilder
- CreateIndex
- CreateTableBuilder
- DatabaseConfig
- DatabaseError
- DatabaseField
- DatabaseKeyMappingStrategy
- DatabaseValue
- DayUnit
- Env
- FrequencyTyped
- Grammar
- HTTPAuth
- HTTPAuth.Basic
- HTTPAuth.Bearer
- HTTPBody
- HTTPError
- HasManyRelationship
- HasOneRelationship
- HasRelationship
- HourUnit
- JoinClause
- JoinType
- Launch
- Log
- MIMEType
- MinuteUnit
- ModelQuery
- MySQLDatabase
- Operator
- OrderClause
- OrderClause.Sort
- OrderedDictionary
- PapyrusClientError
- PathParameter
- PathParameter.DecodingError
- PostgresDatabase
- Query
- Request
- Response
- Router
- RuneError
- SQL
- SQLJSON
- Scheduler
- Schema
- SecondUnit
- Services
- Socket
- StaticFileMiddleware
- StringLength
- Thread
- TokenAuthMiddleware
- WeekUnit
- Weekday
- WhereBoolean
- WhereColumn
- WhereIn
- WhereIn.InType
- WhereNested
- WhereRaw
- WhereValue