I am trying perform a POST request and the request does not go through. I have looked through Perform POST request in Swift already but it does not contain what I'm looking for.
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
    var request = NSMutableURLRequest(URL: NSURL(string: "https://us1.lacunaexpanse.com"))
    println("request url https://us1.lacunaexpanse.com")
    var session = NSURLSession.sharedSession()
    request.HTTPMethod = "POST"
    let apikey = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    println("apikey",apikey)
    let username = "username"
    let password = "password"
    var login = Array(["username", "password", "apikey"])
    let jsonDictionary = ["2.0", "jsonrpc", "1", "id", "login", "method", "login", "params"]
    println("jsonDictionary",jsonDictionary)
    var writeError: NSError?
    let jsonData = NSJSONSerialization.dataWithJSONObject(jsonDictionary, options: NSJSONWritingOptions(), error: NSErrorPointer())
    var resultAsString = NSString(data: jsonData, encoding: NSUTF8StringEncoding)
    resultAsString = resultAsString.stringByAppendingString("empire")
    let url = NSURL.URLWithString("string")
    println("url",url)
    var request2 = NSMutableURLRequest()
    println("Post url =%@",url)
    request2 = NSMutableURLRequest(URL:url)
    request2.HTTPMethod = "POST"
    var connection = NSURLConnection(request: request, delegate: self, startImmediately: false)
    return true
 
     
     
    