rest

Creating a REST webserver with security

Hi, I am very new to creating webservers - and I have had several goes at trying to understand them and write a quick webserver, but it's never quite 'clicked'. At the moment I am under the impression that REST would be most suitable for my purposes (I will explain later). Can anyone either show me a basic code example in Java (using T...

Performing AJAX delete operations restfully in rails

How do you perform delete and put operations restfully in rails? I have read the documentation and thought I was doing everything properly, but I can't seem to get it to work. For example, if I wanted to delete an employee I would create a controller called "EmployeesController" and create a destroy method to perform the delete. Then I...

How to debug RESTful services?

I'm looking for an easy way to lightweight way to debug RESTful services. For example, most webapps can be debugged using your average web browser. Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST. I am not looking to automate tests. I'd like to run new services through a qu...

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

I've seen a couple questions around here like How to debug RESTful services, which mentions: Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST. I've also heard this, that browsers support only GET and POST, from some other sources like: http://www.packetizer.com/ws/res...

RESTifying URLs

At work here, we have a box serving XML feeds to business partners. Requests for our feeds are customized by specifying query string parameters and values. Some of these parameters are required, but many are not. For example, we've require all requests to specify a GUID to identify the partner, and a request can either be for a "get lat...

In which layer are you putting your REST api?

Our application is structured something like: UI <--> REST API <--> Workflow <--> Business Logic <--> DAL <--> DB However, I am seeing a few examples where it looks like people are doing UI <--> Workflow <--> REST API <--> Business Logic <--> DAL <--> DB Is this my imagination? Or is the second option considered a viable alternativ...

How do I use the Rails helper link_to RESTfully in this situation?

I basically want to use link_to to link to the index method of a controller. I tried: <%= link_to 'Recipes', Recipe %> but that outputs: <a href="/recipes/Recipe">Recipes</a> Which is clearly not right, if it left off that last bit it would do exactly what I want it to. I thought that with RESTful stuff I somehow would start to l...

Navigation on validation failure in Seam/JSF

I've been playing with Seam (2.0.2.SP1) for a few weeks, and I have most of the basics nailed down, but I haven't come up with a decent solution to the following. Suppose I have a form at /foo.xhtml, with a rewrite rule such that URLs like /foo.seam?id=<fooId> are converted to /foo/<fooId>. There's a commandButton on the form with an a...

Would you architect the control API of the next-gen Mars rover to be RESTful instead of an RPC?

Forgive me if this verges on being a "discussion" question, but I really would appreciate a yes/no answer, with an appropriate explanation. Suppose you have to design and implement a control API for a robot, say the next generation Mars Rover. Do you architect this API according to RESTful principles, or do you use a classic RPC, ...

REST / SOAP endpoints for a WCF service

Hi, I have a WCF service and I want to expose it as both a RESTfull service and as a SOAP service. Anyone has done something like this before? ...

What are best practices for developing consistent libraries?

I am working on developing a pair of libraries to work with a REST API. Because I need to be able to use the API in very different settings I'm currently planning to have a version in PHP (for web applications) and a second version in Python (for desktop applications, and long running processes). Are there any best practices to follow ...

What should the HTTP response be when the resource is forbidden but there's an alternate resource?

If I have a resource that a requesting client doesn't have access to but I want to notify them about an alternate resource for which they do have access, should I send them a 403 Forbidden with the alternate resource's URI in the header or content? Or should I just send a 303 See Other redirect to the resource to which they have access? ...

Using a backslash (%5c) in a REST WCF URL

I am building a REST service on WCF, and one of the methods I am writing is GetProfile, which will return the profile for a given username. The username will include the user's domain, and so will have the following format: "DOMAIN\username". I therefore have a service called Profiles.svc, which has the following endpoint set up: [Oper...

OutgoingWebResponseContext does not display non-english characters

We have implmented a REST-style get service Using WCF in .Net 3.5. This service retrieves research documents. The string 'synopsis' indicated in the code bolow contains non-english characteres which the browser deliveres as "????????". private void ReturnSynopsisInfo(IApiWebOperationContext context, OutgoingWebResponseContext outgoingR...

Testing REST webservices

HI There, My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. 1) Are there any publicly available RESTful services available on the net for free that someone ...

What's the benefit of Connectedness?

What is the benefit of Connectedness as defined by Resource Oriented Architecture (ROA)? The way I understand it, the crux of Connectedness is the ability to crawl the entire application state using only the root URIs. But how useful is that really? For example, imagine that HTTP GET http://example.com/users/joe returns a link to http:...

RESTful URL design for search

I'm looking for a reasonable way to represent searches as a RESTful URLs. The setup: I have two models, Cars and Garages, where Cars can be in Garages. So my urls look like: /car/xxxx xxx == car id returns car with given id /garage/yyy yyy = garage id returns garage with given id A Car can exist on its own (hence the /car), ...

REST and SOAP

Can somebody explain what is REST and what is SOAP in plain english? And how Web Services work? ...

Using django-rest-interface

I have a django application that I'd like to add some rest interfaces to. I've seen http://code.google.com/p/django-rest-interface/ but it seems to be pretty simplistic. For instance it doesn't seem to have a way of enforcing security. How would I go about limiting what people can view and manipulate through the rest interface? Norma...

RESTful Web Services with ASP.NET MVC

Do you think ASP.NET MVC is able to develop RESTful web services and which approach you would use for it? ...