Ajax call to bounce block for PHP service
I have created a web service using php and when I access from the rest client I get the correct JSON response. I am calling a method from an AJAX call integrated into a Drupal site. the service response is HTML, so it will block the error.
$api_response = array('result' => 1, 'message' => 'Successfully user added!'); header("Content-Type: application/json; charset=utf-8"); $json_response = json_encode($api_response); echo $json_response;
source to share