title: POST request using Alamofire.request and URLRequestConvertible
body: <p>Below is the code of my URLRequestConvertible</p>
  
  <pre><code>enum Router: URLRequestConvertible {
      static let baseURLString = "http://example.com/"
  
      case LoginRequest(String, String)
      case SignUpRequest(String)
      case ForgotPasswordRequest(String)
  
      var URLRequest: NSMutableURLRequest {
  
          let result: (path: String, method: Method, parameters: [String: AnyObject]) = {
              switch self {
              case .LoginRequest(let userName, let password):
                  let params = [userNameKey: userName, passwordKey: password]
                  return ("/AppUsers/login", .POST, params)
              case .SignUpRequest(let profile):
                  let params = [fullNameKey: profile]
                  return ("/AppUsers/add", .POST, params)
              case .ForgotPasswordRequest(let emailId):
                  let params = [userNameKey: emailId]
                  return ("/AppUsers/forgot_password", .POST, params)
              }
          }()
  
          let URL = NSURL(string: Router.baseURLString)
          let request = NSMutableURLRequest(URL: URL!.URLByAppendingPathComponent(result.path))
          let encoding = ParameterEncoding.URL
  
          request.URLRequest.HTTPMethod = result.method.rawValue
          return encoding.encode(request, parameters: result.parameters).0
      }
  }
  </code></pre>
  
  <p>Now, I have below request which is working fine:</p>
  
  <pre><code> Alamofire.request(.POST, CommunicationService.Router.LoginRequest(txtUsername.text!, txtPassword.text!).URLRequest, parameters: ["email_id": txtUsername.text!, "password": txtPassword.text!], encoding: ParameterEncoding.JSON, headers: nil).responseJSON(options: NSJSONReadingOptions.MutableContainers) { (response) -&gt; Void in
          print(response)
      }
  </code></pre>
  
  <p>But I want to make the use of URLRequestConvertible for Parameter passing for POST request. Let me know what is the best way for POST request using below API:</p>
  
  <pre><code> request(.POST, CommunicationService.Router.LoginRequest(txtUsername.text!, txtPassword.text!).URLRequest).responseJSON(completionHandler: { (response) -&gt; Void in
          print(response)
          })
  </code></pre>
  
  <p>Actually, above code is giving Invalid response with below error message</p>
  
  <p><strong>FAILURE: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}</strong></p>
  
  <p>What's wrong with the request generated using request(Method, URLStringConvertible) method?</p>
  
  <p>Can any one help me?</p>