title: How do you get receive data with a PHP rest api?
body: <p>I am putting this data
  {id="1", title="foo", imagedescription="bar"}</p>
  
  <p>This is my PHP endpoint</p>
  
  <pre><code>&lt;?php
  
  // This will update a photo that has been edited
  if (isset($_GET['id'], $_GET['title'], $_GET['imagedescription']))
  {
  $id=   $_GET['id'];
  $title=  trim($_GET['title']);
  $imagedescription=trim($_GET['imagedescription']);
  
  require 'db_connect.php';
  
  $update_query = "Update images Set title = {$title}, imagedescription = {$imagedescription} Where id={$id}";
  
      if($update = $db-&gt;query($update_query))
      {
          $response["success"] = 1;
          $response["message"] = "Photo successfully updated.";
          // echoing JSON response
          echo json_encode($response);
      } 
      else 
      {
          $response["failed"] = 0;
          $response["message"] = "Oops! An error occurred.";
          $response["sql"] = $update_query;
  
          // echoing JSON response
          echo json_encode($response);
      }
  
  }
  else
  {
  // required field is missing
  $response["failed"] = 0;
  $response["message"] = "Required field(s) is missing";
  
  // echoing JSON response
  echo json_encode($response);
  }
  
  ?&gt;
  </code></pre>
  
  <p>I just get {"failed":0,"message":"Required field(s) is missing"} with a 200 success response in Postman.</p>
  
  <p>How do I get the data out of the request using PHP?</p>
  
  <p>This is the Angular Service</p>
  
  <pre><code>(function () {
  angular.module('app')
      .service('PhotosManager', ['$http', function($http) {
  
              this.getPhotos = function () {
  
                  return $http.get("get_all_photos.php");
              };
  
              this.updatePhoto = function (id, data) {
                  return $http.put("update_photo.php"+ id, data);
  
              };
  
      }]);
  
  })();
  </code></pre>
  
  <p>I can see a successful response
  Request Method:PUT
  Status Code:200 OK</p>