Skip to content

Instantly share code, notes, and snippets.

@regularberry
Last active December 29, 2018 02:56
Show Gist options
  • Save regularberry/15e44fd3cf6a28aff04a3e6e25b0e2ec to your computer and use it in GitHub Desktop.
Save regularberry/15e44fd3cf6a28aff04a3e6e25b0e2ec to your computer and use it in GitHub Desktop.
let url = URL(string: "http://0.0.0.0")!
let data = "Secret message".data(using: .utf8)
var request = URLRequest(url: url)
request.httpBody = data
let task = URLSession.shared.dataTask(with: request) { data, response, error in
print("We're all done here")
}
task.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment