title: Upload Video to YouTube in Swift
body: <p>EDIT: Still checking this frequently, will mark as solved when I or someone else helps me figure it out!</p>
  
  <p>I am trying to upload a video to YouTube with YouTube’s REST API via Swift but I am having great difficulty figuring out what to do. I currently have a working GET request. </p>
  
  <p>I'm confused on how the POST request URL should be constructed and where the file location is meant to go in the request. Also I think I should be using the resumbable upload protocol?</p>
  
  <p>I have been struggling through various API's and documentation for 2 days now and am feeling hopeless. </p>
  
  <p>Here is my working code for a GET request.</p>
  
  <pre><code>func getRequestVideoInfo(){
      // Set up your URL
      let youtubeApi = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails%2C+snippet%2C+statistics&amp;id=AKiiekaEHhI&amp;key=" + apiKey
      let url = NSURL(string: youtubeApi)
  
      // Create your request
      let task = NSURLSession.sharedSession().dataTaskWithURL(url!, completionHandler: { (data, response, error) -&gt; Void in
          do {
              if let jsonResult = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.AllowFragments) as? [String : AnyObject] {
  
                  print("Response from YouTube: \(jsonResult)")
              }
          }
          catch {
              print("json error: \(error)")
          }
  
      })
  
      // Start the request
      task.resume()
  }
  </code></pre>