PHP Wamp server not receiving parameters from AlamoFire request
<p>When I receive a request from AlamoFire the script in PHP not recognize the parameter neither in POST, GET nor REQUEST variable.</p>

<p>The code in AlamoFire is </p>

<pre><code>let parameters: [String: AnyObject] =
        ["email" : email,
         "password": password]

    Alamofire.request(.POST, url, parameters: parameters, encoding: .JSON)
        .responseJSON { response in

            print(response)

            switch response.result {

            case .Success: // Connection stablished



            case .Failure(let error): //  Connection not stablished
               print(error)
               self.showLoginError(Constants.connectionError)
            }
    }
</code></pre>

<p>And the code in php is:</p>

<pre><code>$response = array();
header('Content-Type: application/json');
if (isset($_POST['email']) &amp;&amp; isset($_POST['password'])) {
  ... stuff
}else{
    $response["Failure"] = 1;
    $response["message"] = "Required field(s) is missing";
    echo json_encode($response);
}
</code></pre>

<p>Then response in AlamoFire always is the JSON with message of required field</p>

<p>At one point PHP gave me this error:
<strong>PHP Deprecated:  Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0</strong></p>

<p>I had change the php.ini with the option of <strong>always_populate_raw_post_data</strong> to -1 and reach me to the state what I am now.</p>

<p>But if the request URL is like this <strong><a href="http://192.168.1.108:8080/labor/login.php?email=slicingit@yahoo.com&amp;password=brown1234" rel="nofollow">http://192.168.1.108:8080/labor/login.php?email=slicingit@yahoo.com&amp;password=brown1234</a></strong> the server receive the parameter. Also if I create the request using <strong>NSURLSession</strong> with the parameters as part of the HTTP Body the server does get them.</p>