Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of building a REST API server using Zend Framework?

I'm new to Zend Framework (not to PHP), and I need to create a REST based API using Zend.

I've seen examples using Zend_Rest_Server, however other sources state that that has been deprecated.

I'm unable to find a solid example which shows how I should be building such an API.

like image 556
siliconpi Avatar asked Mar 15 '11 13:03

siliconpi


People also ask

What is REST API explain with example?

For example, a REST API would use a GET request to retrieve a record, a POST request to create one, a PUT request to update a record, and a DELETE request to delete one. All HTTP methods can be used in API calls. A well-designed REST API is similar to a website running in a web browser with built-in HTTP functionality.

What is Zend framework used for?

Zend Framework is a collection of professional PHP packages with more than 570 million installations. It can be used to develop web applications and services using PHP 5.6+, and provides 100% object-oriented code using a broad spectrum of language features.


2 Answers

Zend_Rest_Server is indeed deprecated since ZF 1.9, you should use Zend_Rest_Controller instead. The following blog posts could be helpful : Building RESTful Services with Zend Framework and Create RESTful Applications Using The Zend Framework.

like image 56
wimvds Avatar answered Oct 14 '22 18:10

wimvds


May be this link would be helpful: Creating a PHP REST API Using the Zend Framework. This code example support REST data in the format of XML and JSON.

Prerequisites:

PHP version > 5
Zend Framework 1.9.2 (at the minimum)
like image 21
falko Avatar answered Oct 14 '22 18:10

falko