rest

What is the minimal configuration for REST-fully annotated service built on Spring 3 (m3)?

I'm trying to expose a REST-full service (hosted by Tomcat) and can't figure out what is the required configuration for Spring 3 (M3). This is how (example) the service looks like: @Controller @Scope("prototype") public class UsersController { @RequestMapping(value="/users/hello", method=RequestMethod.GET) public String hello()...

ASP.NET RewritePath not working as expected / URL in browser changing

When I try to rewrite a URL in ASP.NET I'm finding that the URL changes on the user's browser. I'm using WCF REST services and I want to change the way that you access URLs. See the code example below. I have an HttpModule that is intercepting requests. public class FormatModule : IHttpModule { #region IHttpModule Members pu...

Secure Web Services: REST over HTTPS vs SOAP + WS-Security. Which is better?

I'm not a security expert by any means, but I favor creating REST-style web services. In creating a new service which needs to have the data it transmits secure. We've entered a debate over which approach is more secure - REST with HTTPS or a SOAP WS with WS-Security. I am under the impression we could use HTTPS for all the web serv...

Servlet parameters and doPut

Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request, HttpServletResponse response) { String name = request.getParameter("name"); // name is null } Using curl to send the request: curl -X PUT \ --data "name=batman" \ --header "Content-Type: text/plain" ...

How to restrict JSON access ?

I have a web application that pulls data from my newly created JSON api. My static HTML pages dynamically calls the JSON api via JavaScript from the static HTML page. How do I restrict access to my JSON api so that only I (my website) can call from it? In case it helps, my api is something like: http://example.com/json/?var1=x&var...

iPhone App: How to get data from an API, parse, and store for later use?

I'm new to iPhone app development so excuse me if I use the wrong terminology, or ask the wrong questions. Basically, I'm trying to write an App that includes downloading a dataset, saving it for later, and checking if the dataset has been updated, but I don't know where to begin. When I say dataset, I mean a multi-dimensional array of ...

How to implement copy paste of a resource in REST?

How would you implement copy-paste support in a RESTful way? Let's say I have book store resource. And books in every store http://mydomain.com/rest/book-stores/1 http://mydomain.com/rest/book-stores/1/books/12 I need the client to be able to invoke copy paste of a book to another store. Implementing the following: PUT http://mydo...

Passing primitive type to WCF RESTful service

I've been banging my head against the wall for the past couple of hours, here's what we're trying to do: a method expects a primitive/simple type as the request body. Originally we tried with a boolean, but that didn't work so we tried with string and object. Same thing. Here's the server-side code [OperationContract] [WebInvoke(UriTem...

How to design a REST API for a webservice whose RPC method has overloaded meanings?

Existing XML webservice Processes XML-RPC style requests in which an operation element which identifies the method to dispatch to. For example: <protocol><operation>810</operation><user>...</user></protocol> The number of parameters vary. The XML-RPC handler interprets the 810 token to mean two things. If it receives an element <user>...

REST in WCF -- PUT and DELETE return "Forbidden"

I created a REST webservice in WCF that originally used POST to perform any inserts and deletes. Mostly out of curiosity, I decided to change the insert to a PUT and the delete to a DELETE. While this worked fine on my local machine (using the built-in VS2008 webserver), I'm getting this error when trying to target an actual server dep...

What causes this error message? The remote server returned an error: (422) Unprocessable Entity.

I try to submit a request to a REST API using WCF; here's what I've done: namespace Sample { [ServiceContract] [XmlSerializerFormat] public interface ISampleApi { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "users.xml", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFor...

RESTFul and Hibernate

Is there a tool that can create RESTFul java services from classes generated with hibernate tool? ...

What can I use to create a REST client in Java?

If I want to use Java to create a REST client, what should I use? Can i use CXF? ...

How do I use ActiveResource with a custom URL scheme?

I'm trying to create ActiveResource objects for three objects in an internal application. There are Tags, Taggings, and Taggables: http://tagservice/tags/:tag http://tagservice/taggings/:id http://tagservice/taggables/:type/:key Tag's :tag is the URL-encoded literal tag text. Tagging's :id is an autoincremented integer. Taggable's ...

how to pass complex queries in rest???

If I understand correctly, in rest style, every query (that is, every action on every resource that does not modifies the resource's state) should be enconded in the querystring, using a get method, with no body at all... am I right? well, I have several applications that comunicate with the db thru an xml message that is handled by a ...

Are there job websites that provide a RESTful API?

Are there any job search websites which offer a REST API to search for or within job offers? Something like how Amazon.com provides a product search API... ...

using .htaccess for REST does 301 redirect

I'm trying to build an extremely simple RESTful test rig for an app I'm working on. I'm using .htaccess to redirect urls to my controller script where I will parse the urls to handle the logic. I have the redirect working, but the problem is that if I do a POST/PUT/DELETE, Firebug shows my requests going to the test rig properly, but I...

REST Media type explosion

In my attempt to redesign an existing application using REST architectural style, I came across a problem which I would like to term as "Mediatype Explosion". However, I am not sure if this is really a problem or an inherent benefit of REST. To explain what I mean, take the following example One tiny part of our application looks like:...

2 legged oauth - looking for information

I want to implement a new REST-based api on our infrastructure, and oauth seems to be the way to go. For our implementation there will first just be server-to-server access, which will be completely unrestricted. I believe this is called 2-legged authorization. Later on, we'd like to allow the API to be consumed by the browser, which w...

Is Content-Type negotiation typical or atypical in REST apps?

My feeling is that Content-Type negotiation is one of those "should do" things for REST, but most frameworks, tools and apps punt on it - and don't, as far as I know. Is this true? What REST programming frameworks support content-type negotiation? Should I expect it to broaden in usefulness? Will it become more common in REST framew...