Home  >  Article  >  php教程  >  PHP实现人人OAuth登录和API调用

PHP实现人人OAuth登录和API调用

WBOY
WBOYOriginal
2016-06-13 11:15:01802browse

人人开放平台给出的PHP SDK,个人感觉写的不怎么样,而且在我的电脑上运行不出来,总是113错误,查文档竟然还没有这个错误码,于是只好自己按照官方给出的文档,用PHP自己实现了一下。代码如下文,没有作封装,只是走了一下流程。如果是仅仅用于人人连接这样的登录验证和简单的API调用,也不是很有必要封装。作为使用人人API的一个PHP示范吧。自己写代码的过程中也参考了官网的SDK代码和DEMO代码。

说明:

1、使用了HttpClient类发起Get和Post请求,文件下载地址

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