-
Notifications
You must be signed in to change notification settings - Fork 14
DecodableRequest
Josh Wright edited this page Jan 14, 2021
·
3 revisions
A type from which a RequestAllowed
can be decoded. Conform your
server's Request type to this for easy validation against a
RequestAllowed
type.
public protocol DecodableRequest
Get a header for a given key.
func header(for key: String) -> String?
- key: The key of the header.
The value of the header for the given key, if it exists.
Get a url query value for a given key.
func query(for key: String) -> String?
- key: The key of the query.
The value of the query for the given key, if it exists.
Get a path component for a given key.
func pathComponent(for key: String) -> String?
- key: The key of the path component.
The value of the path component for the given key, if it exists.
Decode the body of a request as JSON.
func decodeBody<T: Decodable>(encoding: BodyEncoding) throws -> T
Any error thrown decoding the request body to T
.
An instance of T
, decoded from this request's body.
Generated 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