Welcome Guest, Not a member yet? Register   Sign In
RESTful API - Search & CRUD
#11

[eluser]Peng Kong[/eluser]
for Phil's REST response you need to be passing an array not a string. that's why the html part is complaining.

xml part doesn't complain because he has this line...

$data = $this->_force_loopable($data);

which casts your string to array
#12

[eluser]ortenheim[/eluser]
Yes i am using phils example.

i am not sure what you mean by making it to an array..thats what it is already since i get it from my model? and by putting it as force loopable, where is this done? tried it in my controller like so:

Code:
function visitors_get()
    {
        $this->load->model('Visitor_model');
        $visitors = $this->Visitor_model->get_all();
        $visitors = $this->_force_loopable($visitors);
        
                if($visitors)
                {
                    $this->response($visitors, 200); // 200 being the HTTP response code
                }

                else
                {
                    $this->response(NULL, 404);
                }
    }

but i get blank screen instead of previous error.
#13

[eluser]Unknown[/eluser]
Peng Keng, how would you recommend using this RESTful library with your a3m module? I would like to create a RESTful service that I access via an iPhone/Android that requires authentication against a3m. Do you have any suggestions on how to approach that?
#14

[eluser]Peng Kong[/eluser]
i recommend you use Phil's latest rest controller on github (:
a3m doesn't have much to do with api authentication
it has to do with manage of website authentication.




Theme © iAndrew 2016 - Forum software by © MyBB