Welcome Guest, Not a member yet? Register   Sign In
Introducing...REST!
#21

[eluser]jstrebel[/eluser]
Excuse the maybe obvious question.

Can this lib be used to make a request via REST to an outside web service (say upcoming.org) and then parse the xml result into a useable object-> to use within the CI app?
#22

[eluser]Lovecannon[/eluser]
Sorry, but web services don't use a unified protocol for that, so I'm afraid you will have to write your own functions for that. This library is for exposing REST, not making requests
#23

[eluser]noinput[/eluser]
Thank you very much for the contribution, it's working great for me and I just wanted to notate two simple mods I made to the library file and a few things I found out.

First, my rest service sits in a folder under controllers called "services", that way i can keep rest, post & xml-rpc all in one place. However i was having issues simply naming the class "rest" so i use it as "restful" and it works fine Wink Also since the class is being called one path location deeper i modified $i = 2 rather than $i = 1. This jumps the parse one folder deeper.

Lastly I noticed that the class would throw an error when trying to assign an empty index to the segmentArray. so I added the following conditional (also including my index bump from 1 -> 2 for the path issue):

Code:
//starting at line 18
        $i = 2;
         while($i < count($test))
        {
        
            if($test[$i] != ""){
                $array[strtolower($test[$i])] = strtolower($test[$i + 1]);
            }
            $i = $i + 2;
        }

Now this produces a cleaner error free set of arrays in the $this->rest object and everything works awesome.
#24

[eluser]Lovecannon[/eluser]
I will have to add this to the project, but I havent been doin much development on it, but I will try and add the code, thanks for your patch ^_^
#25

[eluser]ricklee[/eluser]
somethign else i found:
http://jan.prima.de/~jan/plok/archives/1...tions.html
#26

[eluser]Unknown[/eluser]
This an old thread, but the first hit on goodle for CodeIgniter REST. So here is my approach to REST with codeigniter, in case anyone is interested.

http://blog.medryx.org/2008/10/03/codeigniter-rest/
#27

[eluser]Joseph1982[/eluser]
Hi,

First of all, I would like to thank you for this

Is it possible to call the API (http://domain-name.com/controller/name_o...ction_name) with an XML file as an argument to the calling function (function_name) ?


What I am trying to do is, to call the function, function_name, with an XML file. And function, function_name, will parse the XML, process & returns the value.


Thank You.
#28

[eluser]Joseph1982[/eluser]
Hello,

How can I create URL to call the Controller Function, if my controller pages is in Sub Folder ?

Regards,
An.Joseph
#29

[eluser]Unknown[/eluser]
So I followed the directions set forth on how to implement Rest.php in the codeigniter library. I would like to test this REST implementation out. I am assuming that the Api controller example is a working example. I keep on receiving this PHP Error:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: function

Filename: libraries/Rest.php

Line Number: 81


Could someone point me in the right direction?
#30

[eluser]darren884[/eluser]
Dude thanks so much for this.




Theme © iAndrew 2016 - Forum software by © MyBB