rest

Beyond the @Produces annotation, how does Jersey (JAX-RS) know to treat a POJO as a specific mime type?

I see a lot of examples for Jersey that look something like this: public class ItemResource { @GET @Path("/items") @Produces({"text/xml", "application/json"}) public List<Item> getItems() { List<Item> items = new ArrayList<Item>(); Item item = new Item(); item.setItemName("My Item Name!"); ...

Do Websites need Local Databases Anymore?

If there's a better place to ask this, please let me know. Every time I build a new website/blog/shopping-cart/etc., I keep trying to do the following: Extract out common functionality into reusable code (Rubygems and jQuery plugins mostly) If possible, convert that gem into a small service so I never have to deal with a database ...

How can I discover the contract of a non-SOAP web API?

Let's say I have the URI for a RESTful or other contract-less API. Is it possible to determine its interface programatically? I'm using C#/ASP.net MVC, not sure if that's important. I understand that there won't be a published contract, but I'm wondering if there's something I'm not thinking of (there usually is). ...

Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question.

I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go: Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that my blog have posts, so I've created a Post class. I've also decided that posts can be created, read, updated, or deleted (s...

Understanding REST through an example

My only real exposure to the ideas of REST has been through Ruby on Rails' RESTful routing. This has suited me well for the kind of CRUD-based applications I have built with Rails, but consequently my understanding of RESTfulness is somewhat limited. Let's say we have a finite collection of Items, each of which has a unique ID, and a...

RESTful issue with data access when using HTTP DELETE method ...

I'm having an issue accessing raw request information from PHP when accessing a script using the HTTP DELETE directive. I'm using a JS front end which is accessing a script using Ajax. This script is actually part of a RESTful API which I am developing. The endpoint in this example is: http://api.site.com/session This endpoint is used...

Does GoDaddy supports RESTful services via WCF

After deploying a WCF RESTful service that i created using the REST started kit, i got several errors that i managed to solve following this post: http://www.edoverip.com/edoverip/index.php/2009/01/30/running-wcf-on-godaddy Now i'm stuck with this error: IIS specified authentication schemes 'Basic, Anonymous', but the binding only supp...

How to document a Symfony based REST API (similar to enunciate's documentation capabilities)

If I have a REST based service written in the Symfony [symfony-project.org] framework (i.e. PHP), is there any decent tools/frameworks out there that will parse my code and generate API documentation? The Java based framework enunciate has documentation capabilities similar to what I need, you can view an example of this here: http://en...

RPC for java/python with rest support, HTML monitoring and goodies

Here's my set of requirements: I'm looking for an RPC framework such as thrift, avro, protobuf (when adding services to it) which supports: Easy and intuitive IDL. No serial numbers, no manual versioning, simple... avro is a good example for this. Works with Java and Python Supports both fast binary prorocol, as well as HTTP based re...

Passing data between states PHP

So I am using Limonade PHP which has a RESTful design which emulates PUT, POST, DELETE routes for create, update, delete. I am trying to develop some form validation which is going well. The major problem I am facing though is how to return my filtered data (which has failed validation) back to repopulate the create or edit form. How w...

Why is cakephp form input stored in $this->data and POST data stored in $this->params['form'] ?

the cakephp rest tutorial says that post data should be in $this->data, but I am finding that it is not, but instead inside $this->params['form'] However, when using cakephp form helper in a view, the data is in $this->data. Am I correct to have to check both locations in my controller? It just seems a bit of a waste of extra code. S...

Mimic remote API or extend existing django model

I am in a process of designing a client for a REST-ful web-service. What is the best way to go about representing the remote resource locally in my django application? For example if the API exposes resources such as: List of Cars Car Detail Car Search Dealership summary So far I have thought of two different approaches to take: ...

WCF 3.5 - Remove SVC Extension - Special Case

I have several RESTful endpoints like such: System.Security.Role.svc System.Security.User.svc etc. This is meant to be a namespace so our RESTful URL's would look like: /rest/{class namespace}/{actions} I have tried a few examples to get the SVC extension removed when my endpoint has multiple periods in it, however, nothing seems t...

REST, HTTP verbs and current development in .NET and silverlight

Hi, I've read several posts in the internet about that Silverlight only supports GET and POST, and that the most of the web browsers too. Is this true? has it changed lately? I'm developing a RESTful web service for a Silverlight application, still in early stage, and I'd like to know if I should use just POST and GET, or otherwise I co...

Spring 3.0 REST implementation or Jersey?

Hi, SO! I'm currently trying to figure out which implementation of JSR-311 I'm going to recommend further up the food chain. I've pretty much narrowed it down to two options - Spring 3.0 with it's native support for REST - or use Sun's own Jersey (Restlets might also be an option). To me it doesn't seem to be much of a difference in th...

WCF REST Does Not Contain All of the Relative File Path

I have a RESTful WCF 3.5 endpoint as such: System.Security.User.svc This is supposed to represent the namespace of the User class and is desired behavior by our client. I have another endpoint I created for testing called: Echo.svc I am writing an overridden IHttpModule and in my module, I follow what almost everyone does by doing...

REST doesn't work with Sever-Client-Client setup

I am having a problem with my current RESTful api design. What I have is a REST api which is consumed by Django web-server, which renders the HTML templates. REST api > Django webserver > HTML The problem I am encountering is that I have to reconstruct all the URLS like mysite.com/main/cities/<id>/stree...

Receiving a JSON string & saving one of the array paramaters to the database as a full string

Hi I have a JSON string that looks like this (Usingt Rails and a REST service) { person: { name:"Pepe", last:"Smith" hats:[ { team:"lakers", color:"purple"}, { team:"heats", color:"red" }] } } I want to be able to able to get that JSON, and save the Person to the database, but I want to s...

RESTful membership

I am currentlly trying to design a RESTful MembershipsController. The controller action update is used only for promoting, banning, approving,... members. To invoke the update action the URL must contain a Parameter called type with the appropriate value. I am not too sure if that is really RESTful design. Should I rather introduce sepe...

Tapestry + REST

Hi all ! I want to add REST to my tapestry project, and so need to know how to implement it. What is the better way ? thx. [Edit, copied from answer:] I have to add GET, PUT, POST and DELETE services to my tapestry application. I see that Tapestry has RESTful url but what about JAX-RS and annotations? ...