EndpointRequest
public enum EndpointRequest
An HTTP Request for an Endpoint. This includes any associated data.
-
A GET request.
Declaration
Swift
case get(params: [String: String]?, extraHeaders: [DiscordHeader: String]?)
-
A POST request.
Declaration
Swift
case post(content: HTTPContent?, extraHeaders: [DiscordHeader: String]?)
-
A POST request.
Declaration
Swift
case put(content: HTTPContent?, extraHeaders: [DiscordHeader: String]?)
-
A PATCH request.
Declaration
Swift
case patch(content: HTTPContent?, extraHeaders: [DiscordHeader: String]?)
-
A DELETE request.
Declaration
Swift
case delete(content: HTTPContent?, extraHeaders: [DiscordHeader: String]?)
-
Helper method that creates the basic request for an endpoint.
Declaration
Swift
public func createRequest(with token: DiscordToken, endpoint: DiscordEndpoint) -> URLRequest?
Parameters
with
A DiscordToken that will be used for authentication
endpoint
The endpoint this request is for
Return Value
a URLRequest that can be further customized