Welcome Guest, Not a member yet? Register   Sign In
REST server (Phil Sturgeon's framewk) wont work with query strings, REST client wont send otherwise.
#1

[eluser]alexanderm[/eluser]
I'm having a really hard time with Phil Sturgeon's REST client. My server, built on Phil Sturgeon's REST server, is responding nicely to get requests, but I need to run other requests against it. Duh, right? How else can I see if my REST service works?

How can I get my client to send "CodeIgniter-esque" urls? All I'm doing is:

Code:
function index()
        {
                $this->load->library('rest', array(
                        'server' => 'http://<ip addr>/dev/alpha/index.php/api/'
                ));
                
                $user = $this->rest->get('user', array('id' => 11), 'json');

                $this->rest->debug();
        }

$this->rest->debug() says that my request is:

http://<ip addr>/dev/alpha/index.php/api/user?id=11

and my server responds with a 404.

How can I make the REST client send the get as .../user/id/11 ???


This all wouldn't be so bad if I could get my server to allow either query strings or CI-esque URLs, but I set $config['enable_query_strings'] = TRUE; in config.php, and my server still won't respond to query strings. It returns a 404. The REST framework never sends the request to my controller.

Please help.
#2

[eluser]alexanderm[/eluser]
http://ellislab.com/forums/viewthread/157000/#766326

Ierva gave me a solution that worked.




Theme © iAndrew 2016 - Forum software by © MyBB