Hello,
you can use CURL Operatation on dialplan or if you wan to do it in AGI, you can set a variable and get this variables from AGI and set variable again get from dialplan
I wrote this quick code using the phpagi class, I havent test it but it should work
#!/usr/bin/php -q
<?php
error_reporting(E_ALL);
set_time_limit(30);
require_once('/root/phpagi-svn/phpagi.php'); //path to the class
$agi = new AGI();
$agi->answer();
$url=file_get_contents("https://development.myapi.php?id=$argv[1]"); // url and argument part
$agi->set_variable("result",$url); // the result of the url is saved on a variable called ${result} so you can use it on asterisk side
exit();
?>