Builder
@objc(SFMCSdkWrappedRequestBuilder)
public class Builder : NSObject
This is a helper class for request building.
- Tag: Builder
-
Initializer for the Builder.
Declaration
Swift
public override init() -
Sets the Http method.
Declaration
Swift
@objc public func method(_ method: String) -> BuilderParameters
methodhttp method
Return Value
self
-
Sets the network call request url.
Declaration
Swift
@objc public func url(_ url: String) -> BuilderParameters
urlrequest url
Return Value
self
-
Sets the network call request url.
Declaration
Swift
@objc public func url(base: String, path: String) -> BuilderParameters
basebase request url
pathrequest url path
Return Value
self
-
Adds or replaces existing header.
Declaration
Swift
@objc public func addOrReplaceHeader(key: String, value: String) -> BuilderParameters
keyheader key
valueheader value
Return Value
self
-
Sets payload of the request.
Declaration
Swift
@objc public func body(_ body: Data) -> BuilderParameters
bodypayload
Return Value
self
-
Sets timeout on the request
Declaration
Swift
@objc public func timeout(_ seconds: TimeInterval) -> BuilderParameters
secondstimeout in seconds
Return Value
self
-
Sets rate limiting on the requet
Declaration
Swift
@objc public func rateLimit(_ seconds: TimeInterval) -> BuilderParameters
secondsrate limiting in seconds
Return Value
self
-
Sets name of the request
Declaration
Swift
@objc public func name(_ name: String) -> BuilderParameters
namerequest name
Return Value
self
-
Sets up tag on the request
Declaration
Swift
@objc public func tag(_ tag: String) -> BuilderParameters
tagrequest tag
Return Value
self
-
Builds request of given parameters.
Declaration
Swift
@objc public func build() -> WrappedRequest?Return Value
WrappedRequest instance
Builder Class Reference