How to build a RESTful API?

Posted by Sharon Haim Pour on Stack Overflow See other posts from Stack Overflow or by Sharon Haim Pour
Published on 2011-01-13T19:00:06Z Indexed on 2011/01/15 2:53 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

Hi friends,

The issue is this: I have a web application that runs on a PHP server. I'd like to build a REST api for it.
I did some research and I figured out that REST api uses HTTP methods (GET, POST...) for certain URI's with an authentication key (not necessarily) and the information is presented back as a HTTP response with the info as XML or JSON (I'd rather JSON).

My question is: 1. How do I, as the developer of the app, build those URI's? Do I need to write a PHP code at that URI?
2. How do I build the JSON objects to return as a response?

I hope I was clear enough.

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about api