title: Creating NSData from NSString in Swift
body: <p>I'm trying to ultimately have an <code>NSMutableURLRequest</code> with a valid <code>HTTPBody</code>, but I can't seem to get my string data (coming from a <code>UITextField</code>) into a usable <code>NSData</code> object.</p>
  
  <p>I've seen this method for going the other way:</p>
  
  <pre><code>NSString(data data: NSData!, encoding encoding: UInt)
  </code></pre>
  
  <p>But I can't seem to find any documentation for my use case. I'm open to putting the string into some other type if necessary, but none of the initialization options for <code>NSData</code> using Swift seem to be what I'm looking for.</p>