title: How to set HTTPBody?
body: <p>In Swift I'm trying to make a post request (using the <code>NSURLSession</code>) to sign in a user to a WebAPI web services.</p>
  
  <p>The Url is <code>www.myurltest.com/Token</code> and I must pass the following string as POST body:</p>
  
  <pre><code>grant_type=password&amp;username=MyUsername&amp;password=MyPassword.
  </code></pre>
  
  <p>So in Swift I've make:</p>
  
  <pre><code>let session = NSURLSession.sharedSession();
  
  let url = NSURL(string:"www.myurltest.com/Token");
  let request = NSMutableURLRequest(URL: url!)
  request.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
  request.HTTPMethod = "POST"
  </code></pre>
  
  <p>Now I want to set the POST body (that is a string) but I don't know how:</p>
  
  <pre><code>request.HTTPBody = ?????
  </code></pre>
  
  <p>Thanks.</p>