Phphttp request problems

Source: Internet
Author: User
Tags http error code 404
Request description HTTPGET request (please use https protocol) mp. weixin. qq. comcgi -... reminder: TICKET remembers that when UrlEncode is returned, the http return code is 200, indicating that ticket is correct. it is an image and can be directly displayed or downloaded. The HTTP header (example) is as follows... request description
Http get request (please use https protocol) https://mp.weixin.qq.com/cgi-.. :ticketrecorded into urlencode
Return description
When ticket is correct, the http return code is 200, which is an image and can be directly displayed or downloaded.
The HTTP header (example) is as follows:
Accept-Ranges: bytes
Cache-control: max-age = 604800
Connection: keep-alive
Content-Length: 28026
Content-Type: image/jpg
Date: Wed, 16 Oct 2013 06:37:10 GMT
Expires: Wed, 23 Oct 2013 14:37:10 + 0800
Server: nginx/1.4.1
In case of an error (such as illegal ticket), the HTTP error code 404 is returned.

How can I get this image ??

Reply content:

Request description
Http get request (please use https protocol) https://mp.weixin.qq.com/cgi-.. :ticketrecorded into urlencode
Return description
When ticket is correct, the http return code is 200, which is an image and can be directly displayed or downloaded.
The HTTP header (example) is as follows:
Accept-Ranges: bytes
Cache-control: max-age = 604800
Connection: keep-alive
Content-Length: 28026
Content-Type: image/jpg
Date: Wed, 16 Oct 2013 06:37:10 GMT
Expires: Wed, 23 Oct 2013 14:37:10 + 0800
Server: nginx/1.4.1
In case of an error (such as illegal ticket), the HTTP error code 404 is returned.

How can I get this image ??

Get the QR code? You can directly splice the ticket and access it after the url.

In fact, direct access means that the obtained body is the image content. Then, you can dump it to the Content-Type format.

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.