Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
how to using curl get api
Hello fellow Fuelers,
Please. Help me using curl in fuelphp get api.
class Controller_Test extends Controller_Rest
public function action_index()
$this->format = 'json';
$curl = Request::forge('
It's a good start.
After you have executed it, the result is in $curl->response(). This will return a standard Fuel response object.
You can access it's payload using $curl->response()->body() (see
If you want to return the json you fetch as an array, use
return \Format::forge($curl->response()->body(), 'json')->to_array();
Note that this only works in REST controllers, standard controllers do not accept an array as return value.
Hi. I can't get api form url
please help me
I don't understand what you mean... You can't get what?
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion