To use the Codeigniter framework to write the backend of WeChat
Some interfaces of WeChat need to use http requests. Does Codeigniter have special classes?
like
Get access token:
http request method: GET
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
Create QR code:
http request method: POST
URL: https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
POST data format: json
POST data example: {"expire_seconds": 1800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
Isn’t it convenient to use curl to send requests? Why do we need to write a special class?
It doesn’t seem to exist, but you can write one yourself
Recommend a class library for CI Curl request, github address: codeigniter-curl