I\'m using the following to post an email and password to my server (php script). The problem I\'m having is the password contains a special char (specifically the &am
Here's some sample code you can try in a playground.
//: Playground - noun: a place where people can play
import UIKit
var n = NSURLComponents()
let s = "blah"
// Note that the values here should not be % encoded
let item1 = NSURLQueryItem(name: "password1", value: "ab%&")
let item2 = NSURLQueryItem(name: "password2", value: "ab%&%#$%^&*(")
n.queryItems = [item1, item2]
n.URL?.query
n.queryItems?.count
n.queryItems![0].name
n.queryItems![0].value
n.queryItems![1].name
n.queryItems![1].value
n.URL