title: ios - Swift JSON Post request
body: <p>I'm new in swift language.This is my JSON which needs to be send to server for user login </p>
  
  <pre><code>data={"email":"test@***.com","password":"mypassword","service":"login","deviceid":"sasa","devicetype":"android"}
  </code></pre>
  
  <p>I tried these codes </p>
  
  <pre><code>    let params = [
              "data": [
                  "email": username,
                  "password": password,
                  "service": "login",
                  "deviceid": "sasa",
                  "devicetype": "android"
              ]
          ]
  Alamofire.request(.POST, "http://***.com/login", parameters: params, encoding: .JSON)
              .responseJSON {  response in
                  print(response)
                          }
  </code></pre>
  
  <p>but the response from server </p>
  
  <pre><code>SUCCESS: {
      service = login;
      status = failure;
      statusmessage = "Failure in post request , please check the key for form data";
  }
  </code></pre>