RESTful URL design for search

For the searching, use querystrings. This is perfectly RESTful: /cars?color=blue&type=sedan&doors=4 An advantage to regular querystrings is that they are standard and widely understood and that they can be generated from form-get.

How to implement REST token-based authentication with JAX-RS and Jersey

How token-based authentication works In token-based authentication, the client exchanges hard credentials (such as username and password) for a piece of data called token. For each request, instead of sending the hard credentials, the client will send the token to the server to perform authentication and then authorization. In a few words, an authentication scheme … Read more

Should a RESTful ‘PUT’ operation return something….

The HTTP specification (RFC 2616) has a number of recommendations that are applicable. Here is my interpretation: HTTP status code 200 OK for a successful PUT of an update to an existing resource. No response body needed. (Per Section 9.6, 204 No Content is even more appropriate.) HTTP status code 201 Created for a successful … Read more

How to design RESTful search/filtering? [closed]

The best way to implement a RESTful search is to consider the search itself to be a resource. Then you can use the POST verb because you are creating a search. You do not have to literally create something in a database in order to use a POST. For example: Accept: application/json Content-Type: application/json POST … Read more

Logout: GET or POST?

Use POST. In 2010, using GET was probably an acceptable answer. But today (in 2013), browsers will pre-fetch pages they “think” you will visit next. Here is one of the StackOverflow developers talking about this issue on twitter: I’d like to thank my bank for making log off a GET request, and the Chrome team … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)