Assalomu alaykum, yordam.uz saytimizga xush kelibsiz.
Bu saytda o`zingizni qiziqtirgan savollarga javob olishingiz va o`z sohangiz bo`yicha savollarga javob berishingiz mumkin. Bizning Oilamizga a'zo bo`lganingiz uchun chuqur Minnatdorchilik bildiramiz !!!

curl da xatosiz xato php :)

0 ovoz
23 marta ko‘rilgan
so‘radi 11 yanvar parmonov98 (1,581 bal)

error_reporting(1);

$_apiBASEURL = 'https://api.instagram.com/';

$params = [

'endpoint_url' => $_apiBASEURL . 'oauth/access_token', 

'type' => 'POST',

'url_params' => array(

'app_id' => '2595594314003681',

'app_secret' => 'f96e18ed650ac271b120a1e361580105',

'grant_type' => 'authorization_code',

'redirect_uri' => 'redirect',

'code' => 'AQDivAHHdTikvaKzTRcEdoMgoMvIuyjz415hNCH1UI2PRLCb3vA43lhaMfF6_TEgv94ByBxbDGG3Giss-v9cnez2opG_7uu1efnb98MYQjixPqQk45DxCDV3UZVcm4ttYqiNF9SdqliFjd4T3vDxmuPTCBVekmXEs1rWkwtFh0dcov6ck9iZN1W8a9Ac5YIYNfjSE3RR1YyFhsn595imTLwFJpsV4CC1Vl38pYWt5GzpzA'

)

];

_makeApiCall($params);

function _makeApiCall($params){

$ch = curl_init();

$endpoint = $params['endpoint'];

if('POST' == $params['type']){

curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params['url_params']));

curl_setopt($ch, CURLOPT_POST, 1);

}

curl_setopt($ch, CURLOPT_URL, $endpoint);

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

//print_r($params);

$response = curl_exec($ch);

//print_r($response);

curl_close($ch);

if(isset($response['error_type'])){

var_dump($response);

die();

}else{

return $response;

}

}

hech qanaqa response olmayapman, error ham bermayapti.

lekin mana koddan keyin  quyidagi array beryapti. sababi nima bo'lishi mumkin? print_r(curl_getinfo($ch));

Array ( [url] => [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) )

bu natija tushunarsiz, menga xatyabi xatolik chqarsh kerak aedi deb . 

1 ta javob

0 ovoz
javob berdi 11 yanvar parmonov98 (1,581 bal)
tanlangan 12 yanvar parmonov98
 
Eng yaxshi javob

$endpoint = $params['endpoint_url'];

url manzil da xatolik bor ekan.

Assalomu alaykum, yordam.uz saytimizga xush kelibsiz.

Bu saytda o`zingizni qiziqtirgan savollarga javob olishingiz va o`z sohangiz bo`yicha savollarga javob berishingiz mumkin.

Bizning Oilamizga a'zo bo`lganingiz uchun chuqur Minnatdorchilik bildiramiz !!!

Telegram kanal YordamUzRss

...