我是API的初学者..我正在做一个项目并考虑包括Site2Sms Api来发送消息。我想使用的API位于link.
API使用Unirest PHP Library调用请求。 有人可以提供示例页面或代码段,甚至可以提供有关如何实现它的想法。
提前致谢
答案 0 :(得分:2)
该页面为您提供了您需要使用的PHP代码段,只需从左侧菜单中选择它即可。然后只需通过Composer安装Unirest:
首先获得Composer。 (谷歌是你的朋友)
使用以下内容制作composer.json
文件
{ “require-dev”:{ “mashape / unirest-php”:“2. *” } }
然后运行:
作曲家需要mashape / unirest-php
按照此处的说明操作:https://github.com/mashape/unirest-php
要求作曲家通过自动加载:
require_once'proforts / autoload.php';
并粘贴上面的mashape页面中的代码。
非常简单..真的。