 import Swish
 
 private let baseUrl = NSURL(string: "https://passport.thegrid.io/")!
+
+
+// MARK: - URL
 
 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")
}

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

    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)
