title: Example of Swift and a Put request for a RESTful API
body: <p>I'm trying to learn Swift by creating an OSX app for the Phillips Hue light API. However, and I feel silly here, I can't even get a simple example working. I'm using this library in X Code 6.1:
  <a href="https://github.com/hallas/agent" rel="noreferrer">https://github.com/hallas/agent</a></p>
  
  <p>Here's the code I'm using:</p>
  
  <pre><code>import Foundation
  
  
  
  let done = { (response: NSHTTPURLResponse!, data: Agent.Data!, error: NSError!) -&gt; Void in
      // react to the result of your request
  };
  Agent.put("/api/[username]/lights/2/state", headers: [ "Header": "Value" ],
      data: [ "hue": 35000 ], done: done)
  </code></pre>
  
  <p>Needless to say its not doing anything. What am I doing wrong?</p>