We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/nickoneill/thatthinginswift/blob/master/content/write-your-own-api-clients-swift.md
I had to make paramString += "\(escapedKey)=\(escapedValue)&"
paramString += "\(escapedKey)=\(escapedValue)&"
to unwrap like paramString += "\(escapedKey!)=\(escapedValue!)&"
paramString += "\(escapedKey!)=\(escapedValue!)&"
to get this to work
The text was updated successfully, but these errors were encountered:
Thanks @rajohns08, looks like stringByAddingPercentEncodingWithAllowedCharacters calls generate optionals there. I'll wrap them in an if let block.
stringByAddingPercentEncodingWithAllowedCharacters
if let
Sorry, something went wrong.
Additionally, I had to change the value variable to a String before adding the encoding:
let escapedValue = String(value).stringByAddingPercentEncodingWithAllowedCharacters(.URLQueryAllowedCharacterSet())
instead of
let escapedValue = value.stringByAddingPercentEncodingWithAllowedCharacters(.URLQueryAllowedCharacterSet())
otherwise I get a NSException.
nickoneill
No branches or pull requests
https://github.com/nickoneill/thatthinginswift/blob/master/content/write-your-own-api-clients-swift.md
I had to make
paramString += "\(escapedKey)=\(escapedValue)&"
to unwrap like
paramString += "\(escapedKey!)=\(escapedValue!)&"
to get this to work
The text was updated successfully, but these errors were encountered: