title: php api doesnt send any message to react native app
body: <p>I am writing a react native code in which I post some values to PHP API by &quot;Axios fetch function&quot;, and I don't get any response . and my PHP code is correct because I tested it in the browser
  here is my code: it should return some message(an array with message) whether success or fail but in the react native app the message is undefined when I alert it.
  react native code(It's a function called by a button and the state has a default value and is never null):</p>
  <pre><code> sendRating(){
      axios.post(&quot;http://192.168.1.107/restaurant/setRate.php&quot;, {
          rating: this.state.Default_Rating,
          ID:this.state.restId
      }).then(response =&gt; {
          if(response.data.message == &quot;success&quot;){
              
              alert(&quot;امتیاز شما ثبت شد&quot;);
              
          }
          else if(response.data.message == &quot;failure&quot;){
              alert(&quot;لطفا بعدا دوباره تلاش کنید&quot;);
          }  
          else{
              alert(response.data.message);
          }
      });
  }
  </code></pre>
  <p>and this is my setRate.php:</p>
  <pre><code>    &lt;?php
      require_once &quot;config.php&quot;;
     $json=file_get_contents(&quot;php://input&quot;);
     $json = json_decode($json , true);
     $Id = $json['ID'];
     $rating=$json['rating'];
     $sqlQuery=&quot;SELECT  `rate` , `id` FROM restaurants WHERE `id`=&quot;.$Id;
     $result=$conn-&gt;query($sqlQuery);
  
     if($result-&gt;num_rows==1){
         $temp=$result-&gt;fetch_assoc();
         $tempVote=$temp['votes']+1;
         $tempRate=(($temp['rate']*$temp['votes'])+$rating)/$tempVote;
  
         $change_rate_query = &quot;UPDATE `restaurants` SET `rate`='$tempRate', `votes`='$tempVote'      WHERE `id` = '$Id'&quot;;
         If ($conn-&gt;query($change_rate_query))
             $data=array('message' =&gt;&quot;success&quot; );     
     }
     else{
         $data=array('message' =&gt;&quot;failure&quot; );
     }
     echo json_encode($data);
     $conn-&gt;close();
  </code></pre>
  <p>?&gt;</p>