Django RESTful API – django-piston vs. django-tastypie

A good resource to compare them is http://www.djangopackages.com/grids/g/api/ Django-tastypie sure is the save choice right now. Personally I’d advocate a look at django-rest-framework if you use django 1.3, because it uses the new class based views. djangopackages.com’s comparison page shows it has good participation and activity. And, wow, it sure has a nice browsable interface … Read more

Why can’t I reference System.Runtime.Serialization.Json in C#

The System.Runtime.Serialization.Json Namespace is in two different DLL’s depending on your .net framework. In .NET 3.5 It is in System.ServiceModel.Web.dll In .NET 4.0 and above It is in System.Runtime.Serialization.dll. Make sure you have added the correct DLL as a reference in your project and add using System.Runtime.Serialization.Json; to the top of your code file. EDIT … Read more

Securing my API to only work with my front-end

Apply CORS – server specifies domains allowed to request your API. How does it work? Client sends special “preflight” request (of OPTIONS method) to server, asking whether domain request comes from is among allowed domains. It also asks whether request method is OKAY (you can allow GET, but deny POST, …) . Server determines whether … Read more

How to use OpenID in RESTful API?

I’ve now spent some time researching the options and would like to summarize the findings. First, a little bit more context — I develop and control both the service and API consumer. Consumer is Flash-based app that is served from the same host the API is now and is supposed to be used in browser. … Read more

API java 5 and more: should I return an array or a Collection?

Prefer Collection (or List, or Set as appropriate) to an array. With generics you get the type-checking that was lacking pre-Java 5. Also, by exposing only the interface, you are free to change the implementation later (e.g. switch an ArrayList for a LinkedList). Arrays and generics don’t mix very well. So, if you want to … Read more

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