-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
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
JSON to NSData #62
Comments
This can be achieved with this code:
|
@k06a, Is there any argument for not adding a wrapper for that operation to SwiftyJSON? |
What wrapper do you mean? |
e.g. |
Use let object = json.object
if let data = NSJSONSerialization.dataWithJSONObject(object, options: NSJSONReadingOptions..AllowFragments, error: nil) {
//post your data to server
} else {
//error
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given that I have a JSON object, how do I get a NSData representation, which is suitable for sending over the network, with e.g. a POST request?
The text was updated successfully, but these errors were encountered: