Home  >  Article  >  Backend Development  >  php http request problem

php http request problem

WBOY
WBOYOriginal
2016-12-05 13:44:131646browse

Request instructions
HTTP GET request (please use https protocol) https://mp.weixin.qq.com/cgi-... Reminder: Remember to perform UrlEncode on TICKET
Return instructions
If the ticket is correct, the http return code is 200 , is a picture that can be displayed or downloaded directly.
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 error (such as illegal ticket), HTTP error code 404 is returned.

How to get this picture? ?

Reply content:

Request instructions
HTTP GET request (please use https protocol) https://mp.weixin.qq.com/cgi-... Reminder: Remember to perform UrlEncode on TICKET
Return instructions
If the ticket is correct, the http return code is 200 , is a picture that can be displayed or downloaded directly.
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 error (such as illegal ticket), HTTP error code 404 is returned.

How to get this picture? ?

Can I get the QR code via WeChat? Just splice the ticket behind the url and access it

In fact, if you access it directly, the body obtained is the content of the image. Then just dump it into Content-Type format.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn