CodeIgniter Forums
CI as a REST API? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Choosing CodeIgniter (https://forum.codeigniter.com/forum-8.html)
+--- Thread: CI as a REST API? (/thread-63233.html)

Pages: 1 2


CI as a REST API? - zurtri - 10-09-2015

I am coding a REST API using the SLIM Framework. 

I am about 30% done of the first cut of the API.

But .... I am finding it a hard slog and I know CI so much better.

Has anyone used CI as a REST API?

I know CI could do this job by my real question should  it do it?

Or should I just suck it up and get the Slim thing working? 

Any guidance from experienced folks with strong opinions is welcome!


RE: CI as a REST API? - orionstar - 10-09-2015

I am using a CodeIgniter controller base class called REST_Controller to create APIs. Check out:
https://github.com/chriskacerguis/codeigniter-restserver

It was originally created by Phil Sturgeon, he write some blog post about it for example:
https://philsturgeon.uk/codeigniter/2009/06/03/REST-implementation-for-CodeIgniter/


RE: CI as a REST API? - zurtri - 10-09-2015

(10-09-2015, 03:37 PM)orionstar Wrote: I am using a CodeIgniter controller base class called REST_Controller to create APIs. Check out:
https://github.com/chriskacerguis/codeigniter-restserver

That is really really exciting and pretty much exactly what I am looking for.

Have you noticed any speed problems?


RE: CI as a REST API? - orionstar - 10-09-2015

I have a pretty old version of this controller in my CMS, maybe 2-3 years old one, so I don't have experience with the current content of the repository. With the old one, we never had performance or any kind of problem in the last ~3-4 years or so...


RE: CI as a REST API? - zurtri - 10-09-2015

Many thanks orionstar.

If it is easier to code for me and performance is not an issue I'm happy enough!


RE: CI as a REST API? - Narf - 10-09-2015

CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.


RE: CI as a REST API? - orionstar - 10-09-2015

(10-09-2015, 04:50 PM)Narf Wrote: CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.

Can you explain what is the "proper" way? Is it really matter, a feature supported out-of-box or with a library?!


RE: CI as a REST API? - zurtri - 10-09-2015

(10-09-2015, 04:50 PM)Narf Wrote: CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.

What makes CI not suitable for REST services?

(and yes famililar != proper  - I agree!)


RE: CI as a REST API? - Narf - 10-10-2015

It's not a matter of whether you use an external library or a built-in one, CI is just made for web pages and doesn't give you control over low-level HTTP functionalities.


RE: CI as a REST API? - imefisto - 11-11-2015

(10-10-2015, 02:29 AM)Narf Wrote: It's not a matter of whether you use an external library or a built-in one, CI is just made for web pages and doesn't give you control over low-level HTTP functionalities.

I've been using CI as API Rest and I'm very happy with it.

I'm curious about the low-level HTTP functionalities you mention.

Off topic: This is my first post in the forum Smile