-
Initialises an endpoint with the given path component.
NOTE: If you pass in several path components like
endpont/additionalPathComponentit will be splitted by/as the url is constructed within theURLFactorywhich uses aURLComponentthat adds all path components by usingURL.appendPathComponent.Declaration
Swift
public init(pathComponent: String)Parameters
pathComponentThe path component to add to the base url.
-
Initialises an endpoint with the given path components.
Declaration
Swift
public init(pathComponents: [String])Parameters
pathComponentsThe path components to add to the base url.
-
# Summary Adding a dictionary of query parameters to the endpoint.
Declaration
Swift
public func addQueryParameters(_ parameters: [String : String?]) -> Endpoint<ResponseType>Parameters
parametersA dictionary containting the query parameters in form [Key: Value]. If the key already exists it will be overriden
Return Value
A new endpoint instance with the merged parameters.
-
# Summary Adding a query parameter to the endpoint.
Declaration
Swift
public func addQueryParameter(key: String, value: String?) -> Endpoint<ResponseType>Parameters
keyThe key of the query parameter to add. If the key is already present, its value will be overriden by the new one.
valueThe value of the query parameter.
Return Value
A new endpoint instance with the added parameter.
-
# Summary Adding a dictionary of path components to the endpoint.
Declaration
Swift
public func addPathComponents(_ pathComponents: [String]) -> Endpoint<ResponseType>Parameters
pathComponentsA dictionary containting the path components in form [Value].
Return Value
A new endpoint instance with the appended path components.
-
# Summary Adding a path component to the endpoint.
Declaration
Swift
public func addPathComponent(_ pathComponent: String) -> Endpoint<ResponseType>Parameters
pathComponentThe path component to add.
Return Value
A new endpoint instance with the added path component.
-
Changes the standard encoder this endpoint. The
Clientwill use this encoder instead ot the encoder in theConfigurationDeclaration
Swift
public func withCustomEncoder(_ encoder: Encoder) -> EndpointParameters
encoderThe encoder to use by the client for this endpoint.
Return Value
A new endpoint instance with the changed encoder.
-
Changes the standard decoder for this endpoint. The
Clientwill use this decoder instead ot the decoder in theConfigurationDeclaration
Swift
public func withCustomDecoder(_ decoder: Decoder) -> EndpointParameters
decoderThe decoder to use by the client for this endpoint.
Return Value
A new endpoint instance with the changed decoder.
View on GitHub
Install in Dash
Endpoint Structure Reference