我使用这个例子在 php 中创建了一个 oauth api
http://code.google.com/p/oauth-php/wiki/ConsumerHowTo#OAuth_Consumer
在消费者页面中,我将参数作为 json 编码字符串传递。
$key = '35345345345vertrtertert'; // fill with your public key
$secret = 'h rtyrtyr767567567567'; // fill with your secret key
$url = "www.server.com/serverurl.php";
$options = array('consumer_key' => $key, 'consumer_secret' => $secret);
OAuthStore::instance("2Leg", $options);
$method = "POST";
$params = array(
'radius' => '50',
'latitude'=>'13.35',
'longitude'=>'17.35'
);
$params = json_encode($params);
并在服务器页面(即 serverurl.php)中使用打印请求
print_r($_REQUEST);
我使用 json decode 解码了字符串,但我得到这个值
Array
(
[radius] => 50
[latitude] => 13_35
[longitude] => 17_35
)
被纬度和经度.
替换_
我如何管理这个