MoltinRequest
public class MoltinRequest
Base class which various endpoints extend from. This class is responsible for orchestrating a request, by constructing queries, authenticating calls, and parsing data.
-
Initialise a new
MoltinRequestwith some standard configurationDeclaration
Swift
public init(withConfiguration configuration: MoltinConfig)Parameters
withConfigurationA
MoltinConfigobject
-
Add some includes to the query
Declaration
Swift
public func include(_ includes: [MoltinInclude]) -> SelfParameters
includesAn array of
MoltinIncludeto append to the requestReturn Value
A instance of
MoltinRequestwhich encapsulates the request. -
Add a limit parameter to the query
Declaration
Swift
public func limit(_ limit: Int) -> SelfParameters
limitThe amount of items to return
Return Value
A instance of
MoltinRequestwhich encapsulates the request. -
Add a sort parameter to the query
Declaration
Swift
public func sort(_ sort: String) -> SelfParameters
sortThe sort order to use
Return Value
A instance of
MoltinRequestwhich encapsulates the request. -
Add an offset parameter to the query
Declaration
Swift
public func offset(_ offset: Int) -> SelfParameters
offsetThe amount of items to offset by
Return Value
A instance of
MoltinRequestwhich encapsulates the request. -
Add an filter parameter to the query
Declaration
Swift
public func filter(operator op: MoltinFilterOperator, key: String, value: String) -> SelfParameters
operatorThe
MoltinFilterOperatorto usekeyThe key for the filter
valueThe value for the filter
Return Value
A instance of
MoltinRequestwhich encapsulates the request. -
Add a header to the request
Declaration
Swift
public func addHeader(_ key: String, withValue value: String) -> SelfParameters
keyThe header key
withValueThe header value
Return Value
An instance of
MoltinRequestwhich encapsulates the request.
View on GitHub
MoltinRequest Class Reference