-
Notifications
You must be signed in to change notification settings - Fork 14
RequestComponents
Represents the components needed to make an HTTP request.
public struct RequestComponents
The method of this request.
let method: EndpointMethod
Any headers that may be on this request.
let headers: [String: String]
The base path of this request, without any path parameters replaced.
let basePath: String
The query string of this request.
let query: String
The full path of this request, including any path parameters and the query string.
let fullPath: String
The body of this request.
let body: AnyEncodable?
Body encoding.
let bodyEncoding: BodyEncoding
Creates a simple RequestComponents
with just a url and an
endpoint method.
public static func just(url: String, method: EndpointMethod) -> RequestComponents
- url: The url of the request.
- method: The method of the request.
The RequestComponents
representing a request with the given url
and method
.
Creates a string representing any URL parameters this request
should have. This returns nil if self.body
is nil or it's
content type is not .urlEncoded
.
public func urlParams() throws -> String?
Any error encountered while encoding the self.body.content
to a URL String
.
The url parameters string of this request, or nil if it has none.
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