0

I need to load a url to delete a playlist in my music app. I don't need to pull any data from it, just load it. Basically, if I copy and paste the url into the browser, the API knows to delete the specified playlist.

Here's what I have so far:

func deletePlaylist(id: String, token: String) {
    dispatch_async(dispatch_get_main_queue(), {
        let url = "app.com/api.php?m=delete_playlist&pid=\(id)&token=\(token)"
    })
}

I've tried NSURLConnect, NSURLSession, etc. but nothing is working. How do I just load the url as if it were pasted into a web browser?

Nick
  • 155
  • 1
  • 2
  • 14
  • You forgot the url scheme. Your browser works without it but you need to include it to create a web NSURL – Leo Dabus Nov 21 '15 at 00:49
  • 1
    I feel dumb. Formatting the url properly would have saved me so much time. Thanks! – Nick Nov 21 '15 at 01:26

0 Answers0