如何使用Unirest php?需要在Mashape中链接Site2Sms吗?

时间:2015-02-14 04:19:48

标签: php api unirest mashape

我是API的初学者..我正在做一个项目并考虑包括Site2Sms Api来发送消息。我想使用的API位于link.

API使用Unirest PHP Library调用请求。 有人可以提供示例页面或代码段,甚至可以提供有关如何实现它的想法。

提前致谢

1 个答案:

答案 0 :(得分:2)

该页面为您提供了您需要使用的PHP代码段,只需从左侧菜单中选择它即可。然后只需通过Composer安装Unirest:

  1. 首先获得Composer。 (谷歌是你的朋友)

  2. 使用以下内容制作composer.json文件

    {     “require-dev”:{         “mashape / unirest-php”:“2. *”     } }

  3. 然后运行:

    作曲家需要mashape / unirest-php

  4. 按照此处的说明操作:https://github.com/mashape/unirest-php

    1. 要求作曲家通过自动加载:

      require_once'proforts / autoload.php';

    2. 并粘贴上面的mashape页面中的代码。

      非常简单..真的。