Domanda

I know HTTP extension is depracated in PHP 5.3 onwords. So is their any way to make a HTTP response. This is my php code in php 5.2. How to make it suitable for php 5.4.

//process the request by fetching the info
$headers = http_get_request_headers();
$result = http_get_request_body();
//do stuff with the $headers and $result variables....
//then send your response
HttpResponse::status(200);
HttpResponse::setContentType('text/xml');
HttpResponse::setHeader('From', 'ABCD');
HttpResponse::setData($sq_data);
HttpResponse::send();
È stato utile?

Soluzione

I think this is based on a misunderstanding:

"in further version of php http extension is not available. iam using wamp server."

The PECL HTTP extension is perfectly available for any current PHP version, it's simply not installed by default and must be installed as a PECL extension. In the best case that's as simple as this typed on the command line:

$ pecl install pecl_http
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top