I want to develop a website which has to communicate with a given RESTful API over HTTP GET, POST, PUT & DELETE a lot.
Now while I have some knowledge in JavaScript, I don’t know much about PHP and other possible languages.
Before digging into any new concepts of web-programming, I want to know what is the best way to do it?
I already realised that pure JavaScript is not appropriate due to cross-domain scripting restrictions. I tried to use a basic PHP proxy but that doesn’t seem to work for all four request types.
During my research I stumbled over several keywords… like
- JavaScript with Proxy
- PHP, symfony framework, Doctrine
- Ruby on Rails
- etc.
What are your experiences regarding this topic? Do you have suggestions for a rather low-skilled web-developer like me in order to set up a basic RESTful client? (Can’t be really that difficult, can it?)
Thanks a lot,
Matthias
I would go with the JavaScript with PHP proxy option. In PHP, you can use cURL or HTTP_Request to do the request with all 4 methods (not sure what went wrong when you tried it, perhaps you could elaborate on that).
There are many PHP rest clients out there that wrap around cURL or HTTP_Request. Here are a few to get you started: