【发布时间】:2014-05-01 15:35:01
【问题描述】:
我是从 下载mashape api的php源代码 https://github.com/composer/composer 网址 我通过 git 命令安装 composer $ curl -sS https://getcomposer.org/installer | php
我包括
{
"require" : {
"mashape/unirest-php" : "dev-master"
},
"autoload": {
"psr-0": {"Unirest": "lib/"}
}
}
composer.json 中的这行代码 我在根目录上创建一个名为 test.php 的新文件并包含
require_once '/test/Unirest.php';
$response = Unirest::post("http://httpbin.org/post", array( "Accept" => "application/json" ),
array(
"parameter" => 23,
"foo" => "bar"
)
);
$response->code; // HTTP Status code
$response->headers; // Headers
$response->body; // Parsed body
$response->raw_body; // Unparsed body
经过以上所有过程 我运行 php 源代码然后显示类“unirest”未找到 有什么办法可以解决吗?
【问题讨论】:
标签: php