changing the htto response status code golang code example
Example 1: how to display the responce of curl in php
$response = get_web_page("http://socialmention.com/search?q=iphone+apps&f=json&t=microblogs&lang=fr");
$resArr = array();
$resArr = json_decode($response);
echo "<pre>"; print_r($resArr); echo "</pre>";
function get_web_page($url) {
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_MAXREDIRS => 10,
CURLOPT_ENCODING => "",
CURLOPT_USERAGENT => "test",
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 120,
CURLOPT_TIMEOUT => 120,
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
Example 2: Wrong response from the webhook: 500 Internal Server Error
{"ok":true,"result":{"url":"https://mujtabax.cf/P_PPPPP/ZOXR/ZOXR.php","has_custom_certificate":false,"pending_update_count":2,"last_error_date":1588783236,"last_error_message":"Wrong response from the webhook: 500 Internal Server Error","max_connections":40}}