Curl: Why is the same code successful?

Source: Internet
Author: User
Curl: Why is the same code successful? if the code is unsuccessful, the image can be displayed.
 

Code 2: unable to display images
 


Reply to discussion (solution)

Code 2 url inaccessible

Http://www.1769pt.com/include/getcode.php is a public url and should naturally be accessible
Http: // 172.16.28.1/root/ef30d3ea-e0c5-448e-8678-c30daccadd20/USER_CACHE/54/66/546686fc-152a-449a-8ae1-7bec1d438fc6/3.jpg is a LAN url, it is hard to say if you can access it

Direct access to the url in Code 2 fails.

$ Error = curl_error ($ ch );
Echo $ error;

Check for any errors.

I have modified the image address of Code 2 and cannot display it.

 

Access directly.

Solved the problem. I tested it on an online website and prompted "HTTP Status 400-HTTP method POST is not supported by this URL"
Then I will comment out // curl_setopt ($ ch, CURLOPT_POST, 1); thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.