API, REST, SOAP, XML-RPC, WTF?!?! |
[eluser]Mr Lazy[/eluser]
Hi, Firstly, sorry for resurrecting this old post, but it is at the heart of what I am trying to understand. I have been using Phil's REST CI implementation, and I totally understand the "GET" users stuff. But it is the put, post and delete I really don't get. How can I call these from a browser URL? In the particular case of Phil's implementation I see that the REST controller looks at the HTTP request: Code: private function _detect_method() Thanks for your help, L.
[eluser]Phil Sturgeon[/eluser]
[quote author="Mr Lazy" date="1259342096"]So I am really stuck. How do you delete a noun (an item from an inventory for example) from a URL?[/quote] Quite simply, you don't! Browsers only support GET/POST. GET works via the URL and forms, POST only works in forms. To get PUT & DELETE working, try using my client library or cURL.
[eluser]Mr Lazy[/eluser]
Thanks Phil, after that very succinct reply, everything now has fallen into place. I do need to use something (a browser) for testing the service I am developing, so I think I will do as you suggest and use cURL. Thanks for the prompt reply.. L.
[eluser]Phil Sturgeon[/eluser]
For testing, both my REST client and the cURL library it sits upon have debug() functions which show a ridiculous amount of data. Try them out and let me know how it goes. :-) Links in sig.
[eluser]Mr Lazy[/eluser]
Just thought I would post this resource if anyone starts developing RESTful and wants to use also use the PUT and DELETE requests, I find a nifty little java tool called "RESTClient" from WizTools. http://code.google.com/p/rest-client/ I used Phil's cURL library, but then I found that it was easier to use this tool's GUI to type long complicated strings into. My final solution will be a PHP service with a java client (not my choice), so this worked out well. I just thought someone might find this useful.... Thanks Phil for all the guidance and the RESTful library. (Hopefully you will read this, but just to let you know on your blog post, the config file link points to the controller library....) Mr L.
[eluser]Phil Sturgeon[/eluser]
Did you try my REST Client library too? It makes working with REST MUCH easier than simply using the cURL library. |
Welcome Guest, Not a member yet? Register Sign In |