SORU
16 HAZİRAN 2012, CUMARTESİ


PHP cUrl file_get_contents vs

Burada bir soru. Nasıl bu kod 2 adet erişim API REST farkı nedir?

$result = file_get_contents('http://api.bitly.com/v3/shorten?login=user&apiKey=key&longUrl=url');

$ch =  curl_init('http://api.bitly.com/v3/shorten?login=user&apiKey=key&longUrl=url');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

onlar aynı sonucu üretmek için bakarsak:

print_r(json_decode($result))

CEVAP
16 HAZİRAN 2012, CUMARTESİ


file_get_contents() basit bir tornavida. Basit için çok büyük Başlığı, HTTP isteği yöntemi, zaman aşımı, cookiejar, yönlendirmeleri ve diğer önemli bir şey de değil istekleri.

setopt stream context ya da cURL ile fopen() aklınıza gelebilecek her bit ve seçenek ile powerdrills.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Absolute Zero(Programming Tutorials)

    Absolute Zer

    22 Kasım 2012
  • AutoStream's Garage419

    AutoStream's

    15 EKİM 2007
  • snookie77

    snookie77

    2 Mart 2006