Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
REST request
  • Does anyone have a Fuel module or package for simplifying REST requests to external APIs?
  • This is what I do when using the Request class.
    $url = "https://api.github.com/repos/fuel/docs/issues";
    
    $params = array(); // header params
    
    $options = array(); // curl options
    
    $response = \Request::forge(
     $url, 
     array(
     'driver' => 'curl', 
     'params' => $params, 
     'options' => $options), 
     'GET' // the method, GET, POST, etc.
    );
    
    $response->execute();
    
  • What do you want to simplify?
    $result = \Request::forge('http://api.example.org/get/some/data', 'curl');
    
  • If that is really how you access an external API, why did you say this: http://fuelphp.com/forums/topics/view/3971#3976 ?
  • Perhaps you should look a bit better? I wrote that on Friday 5th of August 2011, which was just after v1.0 was released. At that time my statement was true...
  • Perhaps I should look a bit better?! I know perfectly well when you wrote it. If you are trying to say that your statement is no longer true, and that there is no planned support for REST requests, couldn't you just say so politely? You don't have to be such a smartarse about it; I saw enough of that attitude at Kohana.
  • Are you even reading what I wrote? FuelPHP has been supporting REST requests since early v1.1, and I even gave you the syntax for calling a REST api in my previous post. And still you go on about us not supporting REST requests?
  • It is obvious that I am reading what you wrote, you patronising arsehole.
    According to your docs, Request::forge() takes a boolean true/false as its second parameter, where your example syntax has 'curl'. Would it have killed you to explain in a more helpful way? I can find no mention of REST requests in the docs, and your example begs a number of questions.
    Anyway, never mind. You don't *have* to be helpful. And as far as I am concerned, you can shove Fuel up your arse.
  • There is no reason to use this kind of language here, I've been very friendly so far. If your issue is that someone has forgotten to document a new feature, then be constructive and say so, so the issue can be solved. We're all human, we can forget things or make mistakes. As for the syntax, if that begs some questions, then ask, and you will be answered.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion