rest

form_for Nested Resources

Here is the route: map.resources :networks do |network| network.resources :channels, :name_prefix => nil end Here is what I have in my for my form. <% form_for ([@network, @channel]) do |f| %> ... <% end %> I get an undefined method error since form_for is trying to call "network_channel_path". This error occurs because I h...

Send form data to HTTPService: how to approach it in Cairngorm?

The form is in a component lauched as a popUp, form data consists in: login:String password:String I thought of a few different ways, but I don't like them.. in the popUp, send button triggers a function that gets the form values and stores them in an Object, then saves the Object in the model, then dispatches a CreateSessionEvent. ...

Add default value into prefix to my routes generated by the *_path methods

I have added into my routes file prefix value to each map.resources line. So it all looks like this: map.resources :subjects, :path_prefix => ':company' I have even added this line for default behavior map.connect ':company/:controller/:action/:id' which is not necessary (I believe) because all the routes are handled with resource...

WCF restful service error while consuming the service.

I have WCF restful service and have property called Image with Imageclass [DataMember] public Image Image { get; set; } and getting the below error when trying to call the method having a object with above property System.Runtime.Serialization.SerializationException: Type 'System.Drawing.Bitmap' with data contract name 'Bitmap:http:/...

Consuming a RESTful JSON API using WCF

I'm new to WCF (and pretty rusty with .NET in general) so there's a distinct chance this is an answered question and I just missed it. I'm building an ASP.NET MVC app that will be using a RESTful JSON-based API for its backend. I've been looking into the different options for how to talk to such an API in .NET and it looks like WCF is t...

REST Uploading a Shapefile

Hi, I'm trying to upload a shape file with REST API. Here is the error I get : No such datastore: ws1,nete I've installed version 1.7.5 together with the restconfig-1.7.5.jar plugin. Here is what I do: 1) Create workspace ws1 curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' -d 'ws1'localhost:8080/geoserver/rest/workspace...

How to send HTML form RESTfully?

I have a URI for a collection of resources called 'facts', and URIs for each 'fact' resource in that collection. The form for creating a new 'fact' should be requested with a GET, I believe, but I'm having trouble deciding what URI it should be made to. A GET to the collection URI should return a list of the 'fact' resource URIs. Each ...

Plugin for declaratively specifying an API in Rails like django-piston

Is there a gem/plugin for defining an API in Rails? I know you can have "RESTful routes" and render to different formats in controller actions, but I'm looking for a more all-around solution, including but not limited to the following: I would like to declare which models to expose (arbitrary resources could also be declared, but conve...

How well does the Recess! PHP Framework play with dojo.data?

Hello, I've been trying to find the perfect php framework for me that integrates with dojo smoothly. I am trying to avoid creating my own framework and I don't want to use the Zend Framework since I don't like it and I have a choice since it's my project. I really like the Recess! framework. It looks easy to get started with a easy to de...

When to make models RESTful?

Just wondering -- how do you know when to add map.resources for a particular model? All of them? The ones you want to be accessible by a public API? Thanks. ...

set method to PUT in rails XML requests

if I do this: curl -X POST -H 'Content-type: application/xml' -d '<person>...</person>' 'http://0.0.0.0:3000/people/12?_method=PUT' I get "Only get, put, and delete requests are allowed." Why? Rails 2.3.2 ...

REST and multiple data formats

Hi guys, Ok, here is the fact. StackOverflow is implemented REST-style. When you visit a specific questions/$id/ URL you get to see the question. The content is returned in HTML because it's what the browser understands. I have to develop my own REST service. Fact is that I have to return multiple formats for the same information. For ...

Is Implementing a HTTP, XML based CRUD Layer a good idea?

I'm making a CRUD "layer" for an application. This will be a simple CRUD application that, for example, stores User information, Favorite links etc. and not do operations on "fact-type" data. It's actually only to store things like Users, Permissions, Rules, Policies etc. that other parts of the application pick up to perform work. Over...

xmlrpc vs json / rest on java google appengine with android client

Can someone please point me to a reference which gives a "full circle" example implementation of either (both with android client and java appengine back end) xmlrpc or json / rest ? I have found a python example but am struggling to find a java version. Bonus points (not really) but if anyone could provide one where the the transport m...

Why don't Django and CherryPy support HTTP verb-based dispatch natively?

It's not the same to POST to an URL than to GET it, DELETE it or PUT it. These actions are fundamentally different. However, Django seems to ignore them in its dispatch mechanism. Basically, one is forced to either ignore HTTP verbs completely or do this on every view: def my_view(request, arg1, arg2): if request.method == 'GET': ...

Rails RESTful to_xml - how to achieve connectedness?

After reading the book RESTful Web Services by Leonard Richardson and Sam Ruby, it seems to me, that the to_xml method of rails is not as restful as it should be. Specifically, the book introduces the Resource Oriented Architecture, one of the tenets of which is connectedness: Representations of a resource should contain not only the dat...

Is REST suitable for document-style web services?

RESTful and document/message-style seem to be two trends to implement web services nowadays in general. By this, I mean REST vs SOAP, and document-style vs RPC-style. My question is how compatible REST is with document-style web services. From my limited knowledge of REST, it is utilizing http GET/POST/PUT/DELETE verbs to perform CRUD-l...

Good approach for a web API token scheme?

Hey folks, I am working on a REST API for a web application that up until now we have developed internally for a couple of companion applications. Now that we are looking at opening up to outside developers we want to add tokens to the API in order to help identify who is making requests and in general to help manage it's use. At this...

Rails: how to RESTful query models through associations?

I'm not getting REST with Ruby on Rails, and I'm hoping someone here can set me straight. Imagine that I'm building a site that keeps track of Widgets and the Users that own those Widgets. So I'd have a UsersController and a WidgetsController, and I could get a list of Widgets or Users with the index actions: GET /users GET /widgets ...

How can I implement a RESTful API in Perl?

I'm trying to implement a RESTful API in Perl. My current idea is to simply parse the path_info with a regex then dispatch the request to the appropirate subroutine which will then spit out the JSON, XML or even XHTML for the requested reource. For example to retrieve info about user 134 the RESTful cleint should find it at: http://mys...