title: Swift - Alamofire "Invalid value around character 0."
body: <p>I found some thread the same problem but their answers not works for me.</p>
  
  <p>I have a <code>post</code> request to check user login.</p>
  
  <blockquote>
    <p>Url form :</p>
  </blockquote>
  
  <p>"<a href="http://support.xxx.xx:8031/serpapi/login/checkLogin" rel="nofollow noreferrer">http://support.xxx.xx:8031/serpapi/login/checkLogin</a>"</p>
  
  <blockquote>
    <p>Parameters :</p>
  </blockquote>
  
  <pre><code>["contextInfo" : 
        ["clientId": "1000000", "orgId": "1000001",
        "warehouseId": "1000002", "roleId": "0"],
        "userName": "hanoiaUser", "password": "hanoiaUser"]
  </code></pre>
  
  <blockquote>
    <p>Request : </p>
  </blockquote>
  
  <pre><code>Alamofire.request(url!, method: .post, parameters: params).responseJSON { (response) in
          print(response)
      }
  </code></pre>
  
  <blockquote>
    <p>Error response : </p>
  </blockquote>
  
  <pre><code>FAILURE: responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}))
  </code></pre>
  
  <p>Why am i getting this error? and how to solve it ? </p>
  
  <p>Edit : i'm tried with POSTMAN and it return response : </p>
  
  <blockquote>
    <p>Content-Type : application/json</p>
    
    <p>Body : raw - json</p>
  </blockquote>
  
  <pre><code>{
  
      "contextInfo" : {
         "clientId":1000000,
         "orgId": 1000001,
         "warehouseId": 1000002,
         "roleId": 0
      },
     "userName": "hanoiaUser",
     "password": "hanoiaUser"
  }
  </code></pre>
  
  <blockquote>
    <p>RESPONSE : </p>
  </blockquote>
  
  <pre><code> {
          "success": true,
          "data": [
              {
                  "userId": 1000003,
                  "userName": "hanoiaUser",
                  "token": "b7e804d25065e5c3ac97d765180b7986"
              }
          ],
          "error": null
      }
  </code></pre>