[关闭]
@fuyb1986 2018-10-18T05:12:45.000000Z 字数 1485 阅读 613

生成奖状发微博

儿童编程


发奖状

Method and URL Structure

Method MethodResource URL Descriptions Authentications Required
POST /server/weibo_share/share/ YES

Request Params

Name Description Required Default
name 名字 YES
text 文字信息 YES
redirect_uri 微博验证通过后回调的 html5 地址, 例如: https://coding61.com/weibo.html YES
share_uri 微博上显示的链接地址 YES

cURL Example

  1. curl -X POST --data '{...}' http://127.0.0.1:8000/server/weibo_share/share/

JSON Response

正常返回
  1. {
  2. "status": 0,
  3. "message": ""
  4. }

访问微博验证接口

Method and URL Structure

Method MethodResource URL Authentications Required
POST /server/weibo_share/access_token/

Request Pramaters

  1. {
  2. "redirect_uri": ""
  3. "share_uri": ""
  4. }

Request Data

Name Description
redirect_uri 微博验证通过后回调的 html5 地址, 例如: https://coding61.com/weibo.html
share_uri 微博上显示的链接地址

cURL Example

  1. curl -X POST -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
  2. --data {...} http://127.0.0.1:8000/server/weibo_share/access_token/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "url": "https://api.weibo.com/oauth2/authorize?client_id=3843589308&display=mobile&response_type=code&redirect_uri=https://develop.cxy61.com&state=e76hma75g9jm5aeo48ala412ibbhm6hp",
  5. }

获取用户信息

Method and URL Structure

Method MethodResource URL Authentications Required
POST /server/weibo_share/get_user_info/

Request Pramaters

  1. {
  2. "redirect_uri": ""
  3. "code":""
  4. }

Request Data

Name Description
redirect_uri 微博验证通过后回调的 html5 地址, 例如: https://coding61.com/weibo.html
code 微博返回的 code

cURL Example

  1. curl -X POST -H 'Authorization: Token db02586eda69b432699b2f9031e02e8f5deda8db'
  2. --data {...} http://127.0.0.1:8000/server/weibo_share/access_token/

JSON Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. ...
  5. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注