title: Send POST request with JSON object and query param to REST webservice using alamofire
body: <p>I'm trying to send POST request to REST webservice using alamofire </p>
  
  <p>I'm passing json object as POST body, and i'm getting the response and everything works fine till now </p>
  
  <pre><code>Alamofire.request(.POST, path, parameters: createQueryParams(), encoding: .JSON)
              .responseArray { (request, response, myWrapper, error) in
                  if let anError = error
                  {
                      completionHandler(nil, error)
                      println("Error in handling request or response!")
                      return
                  }
                  completionHandler(myWrapper, nil)
          }
  
  private class func createQueryParams() -&gt; [String:AnyObject]{
          var parameters:[String:AnyObject] = [String:AnyObject]()
          parameters["lat"] = lLat!
          parameters["lng"] = lLon!
  
          if category != nil { // here is the problem
              parameters["category"] = category!
          }
  
          return parameters
      }
  </code></pre>
  
  <p>I have a category filter, if there is a value in category variable, i want to send it as QueryParam (should encoding be .URL? but how can i send json object ??) </p>
  
  <p>this code does not work</p>
  
  <pre><code>if category != nil {
              parameters["category"] = category!
          }
  </code></pre>
  
  <p>How can i do this? Hope I can explain it clearly</p>
  
  <p>Thanks in advance</p>