rest

Event Based interaction style in REST

I am currently struggling with a design issue involving REST. The application I am designing has a requirement to send out events and also support pub/sub style of interaction. I am unable to come up with a design to provide these interaction style without breaking the REST’s “Stateless interaction” constraint. I am not against polling a...

How would I generate / parse this RESTful url in codeigniter

I'm new to MVC, being RESTful, and CodeIgniter and I'm trying to get into it in my spare time, so this is largely an academic question. I'm trying to build a url that will display the availability of a particular hotel room, for a particular hotel. I figured the RESTful way to do this would be http://url/Hotel/2/RoomAvailability/3/ ...

REST and RESTful - videos or pod casts

Hi I am looking for podcast or videos on REST and RESTful. Ideally they should cover the basics & the more advanced topics ...

using asp.net mvc for REST based endpoint

I'm looking at using ASP.Net MVC as a platform for a REST based Service. I know WCF has built in support for REST services; however, I'm looking at returning multiple types of data depending on the request. I would like the client to request the content type. So if they send text/html for example I would render my model into Html, if t...

Is the semantic of the data integral part of REST?

This is a follow up on a question asking for an explanation of REST. As you can see from the comments to my answer, we've had a small argument with Darrel Miller on the best media representation of the resources. We've had a further email discussion that resulted in this question. The main difference between Darrel's and mine understan...

Why does my C# client, POSTing to my WCF REST service, return (400) Bad Request?

I'm trying to send a POST request to a simple WCF service I wrote, but I keep getting a 400 Bad Request. I'm trying to send JSON data to the service. Can anyone spot what I'm doing wrong? :-) This is my service interface: public interface Itestservice { [OperationContract] [WebInvoke( Method = "POST", UriTemplat...

How would you design a RESTful voting system?

In my continuing quest to try and wrap my mind around RESTful-ness, I've come to another place where I'm not sure how to proceed. I set up a thought expiriment for myself where I'd design a simple voting system for a resource, much like how SO allows voting on questions. So, say my resource is an image, and I can get an image by an ID, l...

JAX-RS / Jersey how to customize error handling?

I'm learning JAX-RS (aka, JSR-311) using Jersey. I've successfuly created a Root Resource and am playing around with parameters: @Path("/hello") public class HelloWorldResource { @GET @Produces("text/html") public String get( @QueryParam("name") String name, @QueryParam("birthDate") Date birthDate) { // ...

Has anyone used the new WCF REST Starter Kit successfully and would you use it again?

As the title suggests, I would like to see if this is something people are happy with. I have several projects, where I will dedicate some time in experimenting with different kinds of technologies web service related, preferably alternatives to SOAP which would be well integrated inside/with dotnet. I would like to hear if there are a...

Howto restfully expose related-parent-child resources?

I'm designing an api and I'd like to allow users and groups to have saved searches, but am uncertain how to best expose this information. I've come up with a few URI's to expose them: # These are for CRUD the search definitions, not running the searches 1. /users/{username}/searches # lists the searches for a user 2. /users/{username}/...

Variations on a simple webservice/API: Summing a list of numbers.

In another question I asked for different implementations of a simple RESTful webservice. It was pointed out, however, that the API I defined was not particularly RESTful. My question: Is that a bad thing? More specifically: What are alternative ways to define such an API? I'll add the answer from the problem definition in the other qu...

Rails & Acts-as-versioned: How would you restfully revert records?

How can you revert records in a way that respects REST conventions and routing? I am looking for examples of how to setup my routes.rb and build the link & controller action to do the revert. All the examples I have found are pre-REST rails. My understanding is that I need to have revert_to_version function in my resource controller....

Google JSON/Ajax API - how do you get the next page of results?

According to : http://code.google.com/apis/ajaxsearch/documentation/#fonje I get back a cursor result, but stupidly, the moreResultsUrl returns a URL NOT to the JSON service but to the main site - how do instead fetch the next page of results into JSON? ...

Rails: ActiveResource - Can I set the ID explicitly?

I am using ActiveResource in Rails to manage entities in a separate database over REST. I have been trying to explicitly manage the IDs of the remote resources, as for the current case it is simplest to just re-use the local resource's ID, rather than maintain a different field. Unfortunately I have not been able to get this working as...

PHP client calling .net 3.5 sp1 web service

I need to create a web service that a PHP client can call. The service needs to accept 1 or many integers, provide security, and does not need to return any data (though other similar services may need to). This particular service will is intended to trigger a data extract that will be picked up later. My manager believes that creating ...

WCF Test Client error: Failed to Invoke the service

I'm getting an error when trying to use the WCF Test Client with my WCF service. Here is the service code: [ServiceContract] public interface IEmployeeService { [OperationContract(Name = "GetEmployee")] [WebGet(RequestFormat = WebMessageFormat.Xml, UriTemplate = "/Employees/{employeeNumber}")] Employee GetEmployee(strin...

How do I define RESTful routes in Rails for a resource which has multiple key fields?

My User model has the usual id primary key, but it also has a unique login which can be used as an identifier. Therefore, I would like to define routes so that users can be accessed either by id or by login. Ideally, the routes would be something like this: /users/:id (GET) => show (:id) /users/:id (PUT) => update (:id) ... /users/lo...

Best way to support "application/x-www-form-urlencoded" post data with WCF?

I'm building a WCF service based on a W3C specification which defines a RESTful web service endpoint that accepts "application/x-www-form-urlencoded" post data. WCF doesn't support this type of message encoding by default and I have found a number of different examples of creating a contract that looks like this: XElement Query_Post(St...

RESTful WCF service that can respond in both JSON(P) and XML and still be used as SOAP web service?

Given a contract such as: [ServiceContract] public interface IService { [OperationContract] [WebGet(UriTemplate = "GetData/{id}.{format}")] ResponseData GetData(string id, string format); } Is there a way to get the service to respond with json when requested as: /GetData/1234.json, xml when requested as /GetData/1234.xml ...

HTTP POST with URL query parameters -- good idea or not?

I'm designing an API to go over HTTP and I am wondering if using the HTTP POST command, but with URL query parameters only and no request body, is a good way to go. Considerations: "Good Web design" requires non-idempotent actions to be sent via POST. This is a non-idempotent action. It is easier to develop and debug this app when the...