title: Getting 404 error when request is made through Alamofire in swift3
body: <p>First of all, we are using below code so as the api's works only on mobile devices and not on browsers per say.
  "</p>
  
  <pre><code>$iPod = stripos($_SERVER['HTTP_USER_AGENT'], "iPod");
      $iPhone = stripos($_SERVER['HTTP_USER_AGENT'], "iPhone");
      $iPad = stripos($_SERVER['HTTP_USER_AGENT'], "iPad");
      $Android = stripos($_SERVER['HTTP_USER_AGENT'], "Android");
  
  $json_data = json_decode(file_get_contents('php://input'));
  if ($json_data) {
      $username_1 = $json_data-&gt;username;
      if ($Android || $iPad || $iPhone || $iPod) {}
  </code></pre>
  
  <p>Secondly, the api's are working on android(using volley) and in ios objective-c using AFNetworking. But, now i am porting the project to swift3 and i am using "Alamofire" for network calls.</p>
  
  <p>Method:: (This is how i make POST request):</p>
  
  <pre><code>let headers : HTTPHeaders = [
              "Accept" : "application/json"
          ]
  
  Alamofire.request("API URL", method: .post, parameters: parameters, encoding: JSONEncoding.default, headers: headers)
              .responseJSON{
                  response in
                  if let json = response.result.value{
                  }
  </code></pre>
  
  <p>But, i am getting error 404, which we usually get when we hit api in browser.
  After that i removed that backend check and the request worked fine and got the proper response. But, we can't remove that check. So help me, if i am making any mistakes with headers of something else.</p>
  
  <p>This is what i am getting in debugPrint(response)::</p>
  
  <pre><code>{ status code: 200, headers {
      "Access-Control-Allow-Origin" = "*";
      "Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
      Connection = "Keep-Alive";
      "Content-Encoding" = gzip;
      "Content-Length" = 84;
      "Content-Type" = "text/html; charset=UTF-8";
      Date = "Thu, 14 Sep 2017 17:03:17 GMT";
      Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
      "Keep-Alive" = "timeout=5";
      Pragma = "no-cache";
      Server = "Apache/2.4.25";
      Vary = "Accept-Encoding,User-Agent";
      "X-Powered-By" = "PHP/5.6.31";
  } }
  [Data]: 80 bytes
  [Result]: SUCCESS: {
      "is_valid" = 0;
      status = 404;
      "status_message" = "access denied";
      success = 0;
  }
  </code></pre>