I have created a oauth api in php using this example
http://code.google.com/p/oauth-php/wiki/ConsumerHowTo#OAuth_Consumer
And in the consumer page i am passing the params as json encoded string.
$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);
And in the server page(ie serverurl.php) am printing the request using
print_r($_REQUEST);
And i decoded the string using json decode, but am getting this value as
Array
(
[radius] => 50
[latitude] => 13_35
[longitude] => 17_35
)
The .
is replaced with _
in latitude and longitude
How i can manage this
str_replace()
. It's a hacky solution, but it will work. – Matt Aug 3 '12 at 14:20