Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What do you think would be the primary reasons to make APIs with REST or OData instead of just making everything custom (for example only using GET requests, even for setting variables). Reasons for the opposite also welcome.

As a bit of background, it's going to be used for a request that is sent once every few minutes as a master-server updater for a game (as well as by clients for querying).

share|improve this question

2 Answers 2

up vote 3 down vote accepted

The main reason is because you (attn buzzword bingo) fully leverage HTTP.

For example, if you only use GET requests, caches or proxies may get in the way, not (re)sending requests when you want to.

Using URLs to identify resources, means you can use all your favorite web-server tools, such as mod_rewrite.

Compare this to SOAP for example, which uses one URL and posts all requests there. That makes the URL useless. You cannot use log-file analysis tools to see which requests are popular, you need specific tools to do load testing, etc.

share|improve this answer

Because REST plays well with others. When using a rest interface, you may use all the nice things that were invented for http. For example, you get load balancers, command line clients, traffic analysers more or less for free. When implementing a custom protocol on top of TCP/IP, you have to write them yourself. When using HTTP 'incorrectly', the http-tools wont work correctly (for example, they could cache a get request you expect to have a side effect, or execute it preemptively)

share|improve this answer
1  
and besides that: all the cool kids are doing it. –  keppla May 30 '11 at 15:26
    
Great points, +1 –  Teo Klestrup Röijezon May 30 '11 at 15:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.