title: Add POST,PUT,DELETE request class for swift
body: <p>I have create a client service class to make call <code>GET</code> request from web api. I tried to extended but have more web method <code>POST</code>,<code>PUT</code>,<code>Delete</code>.I don't find good example in how to create POST,PUT,Delete using swift closure.I just want to ask how to add POST,PUT,Delete to client service?</p>
  
  <pre><code>import Foundation
  
  class ClientService{
  
      func getClients(searchstring:String,pageNumber:Int,callBack:(NSArray)-&gt;()){
          request("\(_settings.baseUrl)Client/\(searchstring)/\(String(pageNumber))/rrn/brns", callBack: callBack)
      }
  
      func request(url:String,callBack:(NSArray)-&gt;()){
          let nsURL = NSURL(string:url);
          let task = NSURLSession.sharedSession().dataTaskWithURL(nsURL!){
              (data,response,error) in
              do {
                  let response = try NSJSONSerialization.JSONObjectWithData(data!, options:  NSJSONReadingOptions.MutableContainers) as! NSArray
                  callBack(response)
              } catch let error as NSError {
                  print("json error: \(error.localizedDescription)")
              }
          }
          task.resume()
      }
  
      init(){
          self._settings = Settings();
      }
  
      var _settings:Settings!;
  }
  </code></pre>