Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 932 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drupal as backend for RESTful API?

#1
Are there any good write-ups on creating RESTful APIs with Drupal? I see the services API, which I guess is how it's done. What I'm looking for, I suppose is a comparison of drupal vs. other frameworks for that particular purpose.

Update - a bit more info:

In particular, I'm probably going to want to be returning json, and ideally using http request verbs (PUT, POST, GET, DELETE) properly with the common resource urls. I.e.

[To see links please register here]

(POST -> create, GET -> view, PUT -> update, DELETE -> delete) as opposed to

[To see links please register here]

Reply

#2
I haven't worked with Drupal 7 for such purposes, but over the summer I was tasked with building a RESTful service in Drupal 6. Drupal 6 is fairly ill-suited to developing web services: the data model is built around content nodes, and the theming system is built around returning rendered HTML, so you wind up fighting with the framework a fair amount.

The Services module is decent, but ultimately, we went with [Django Piston][1]. Developing the service in Piston took far less time and was reliable and performant.


[1]:

[To see links please register here]

Reply

#3
Drupal Services 3.0 makes creating REST services much easier than it was with the previous versions (2.x). Also Services 3.0 works with Drupal 6 and Drupal 7.
Reply

#4
If you are looking for a good framework to built a RESTful architecture, I would greatly suggest:

[1. Recess Framework][1]
Well, recess is great, you direct routes to functions through URL and redirect control to other functions. It has a simple ORM that allows you to do great things in little time.

[2. Fat-Free Framework][2]
I've not used F3 but i know its simple, well-documented, allows routing for restful architecture and has its ORM

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#5
I cannot compare with other frameworks, but [Service 3.x][1] (that's version 3 of the [Services][2] module) provides a resource driven model for service with a REST backend (and an XML-RPC one). According to its documentation, you can [create a new resource type][3] quite easily (if you are familiar with Drupal) using a simple API as it takes care of JSON[P]/XML parsing and serialization.

**Updated, prompted by David Eads' answer:**
I wouldn't start with Drupal and Services 3.x if the only end need is to build a RESTful service. They are not generic solution to build a data backend with a RESTful API. They should be used when what is needed is a CMS powered website exposing (parts of) its data through a RESTful API.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through