2013-07-18 9 views
10

मैं pinterest.com पर एक साधारण curl अनुरोध भेज रहा हूं। जब मैं PHP का उपयोग कर ऐसा करता हूं तो कोई परिणाम नहीं दिखाया जाता है। मैंने इसे कमांड लाइन से आजमाया और कोई परिणाम नहीं दिखाया।curl अनुरोध अनुरोध रिटर्न कोई आउटपुट

curl 7.27.0 (i686-pc-linux-gnu) libcurl/7.27.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.25 librtmp/2.3 
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: Debug GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

मैं खोज की है लेकिन सुलझा नहीं कर सकता है: तो फिर मैं curl में वर्बोज़ मोड की कोशिश की और यह देता है। मैं क्या गलत कर रहा हूं? केवल सुलभ यह है https द्वारा:

आदेश है:

curl -v pinterest.com 
+0

कृपया परीक्षण करने के लिए उपयोग कर रहे सटीक कमांड को प्रदान करने के लिए संपादित करें। –

+1

@jcomeau_ictx: –

उत्तर

27

चेक हेडर

$ curl -L http://pinterest.com/ 
<!DOCTYPE html> 
<!--[if IE 7 ]><html lang="en" class="ie7 ielt9 ielt10 en"><![endif]--> 
<!--[if IE 8 ]><html lang="en" class="ie8 ielt9 ielt10 en"><![endif]--> 
<!--[if IE 9 ]><html lang="en" class="ie9 ielt10 en"><![endif]--> 
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class=" en"><!--<![endif]--> 

<head> 
    <script> 
[snip] 
:

$ curl --dump-header - http://pinterest.com/ 
HTTP/1.1 302 FOUND 
Accept-Ranges: bytes 
Age: 0 
Content-Type: text/html; charset=utf-8 
Date: Thu, 18 Jul 2013 19:25:49 GMT 
Etag: "d41d8cd98f00b204e9800998ecf8427e" 
Location: https://pinterest.com/ 
Pinterest-Breed: CORGI 
Pinterest-Generated-By: ngapp-b7f64694 
Pinterest-Version: a8eef3c 
Server: nginx/0.8.54 
Set-Cookie: csrftoken=A2VQZGarr509JKxrJxiuW2MbrXNdHlUH; Domain=.pinterest.com; expires=Thu, 17-Jul-2014 19:25:49 GMT; Max-Age=31449600; Path=/ 
Set-Cookie: _pinterest_sess="eJwz84isyvfJcilP1S4szHY20A6MKitJKwwPdi+2tY8vycxNtfUN8TX2c3E19gsJNfAPtLVVK04tLs5MsfXMcjTxq/KsAGJj3/CgHL+QoGzfrLCMSKNAIz93X+PIrHQTIF0eFe6X4ZluawsAh3UjNA=="; Domain=.pinterest.com; expires=Sun, 13-Jul-2014 19:25:49 GMT; Max-Age=31103999; Path=/ 
Vary: Cookie 
Via: 1.1 varnish 
X-Varnish: 1991078486 
Content-Length: 0 
Connection: keep-alive 

आप -L विकल्प का उपयोग करते आप पृष्ठ मिलेगा

यहां this link में यह PHP के साथ किया गया है:

[वर्षों बाद ...] भी, -V--version है, --verbose नहीं, जो लोअरकेस -v है। curl -V का आविष्कार करने से यह संस्करण प्रदर्शित होता है और किसी भी तर्क को अनदेखा करता है, इसलिए आपको वैसे भी पृष्ठ कभी भी नहीं मिलेगा।

+0

प्रदान किया गया यह मुझे : ~ $ curl -D http://pinterest.com/ कर्ल: कोई यूआरएल निर्दिष्ट नहीं है! कर्ल: अधिक जानकारी के लिए 'curl --help' या 'curl --manual' आज़माएं कोई सुझाव? \ –

+1

ने मेरे कट-एंड-पेस्ट को बोर्क किया। क्षणिक रूप से ठीक हो जाएगा। –

+1

-D को एक तर्क की आवश्यकता है, जो stdout के लिए '-' हो सकता है। मैंने अपने कट-एंड-पेस्ट के साथ समस्या का एक गुच्छा देखा लेकिन उसे पकड़ नहीं लिया। उसके लिए माफ़ करना। –

संबंधित मुद्दे