     components.queryItems = queryItems.isEmpty ? nil : queryItems
     return components.URL
 }
+
+
+// MARK: - Request
 
 func createRequest(method: RequestMethod, _ path: String, token: String) -> NSMutableURLRequest {
     let request = createRequest(method, path)

import Swish

private let baseUrl = NSURL(string: "https://passport.thegrid.io/")!

func createUrl(path: String, _ queryItems: [String: String] = [:]) -> NSURL? {
    guard let url = NSURL(string: path, relativeToURL: baseUrl),

private func setAuthorizationHeaderForRequest(request: NSMutableURLRequest, token: String) {
    request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
}


// MARK: - Request Parameters

private func createRequestParameters(clientId clientId: String) -> [String: String] {
    return [ "client_id": clientId ]
