Home  >  Article  >  Backend Development  >  搞过微信公众平台开发的帮帮小弟啊 感谢了,该如何解决

搞过微信公众平台开发的帮帮小弟啊 感谢了,该如何解决

WBOY
WBOYOriginal
2016-06-13 11:45:22853browse

搞过微信公众平台开发的帮帮小弟啊 感谢了
获取access token

http请求方式: GET
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET

正常情况下,微信会返回下述JSON数据包给公众号:

{"access_token":"ACCESS_TOKEN","expires_in":7200}


上面是微信公众平台的官网说明文档上获取access_token的部分内容,现在有疑问啊

目前我只知道通过复制上面的的url到地址栏中获取到access_token,如果使用代码的话,该如何操作啊?
我试过两种方式,一是使用file_get_contents,无效,二是使用jquery中的getJSON方法(因为我看接口返回的是json数据),也失败。
所以,凌乱了,这个该怎么获取,如何代码实施?
求助,感谢。

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