title: Using GET and POST vs getter and setter methods (URLS)
body: <p>As a trained programmer, I have been taught, repeatedly to use getter and setter methods to control the access and modification of class variables.  This is how you're told to do it in Java, Python, C++ and pretty much every other modern language under the sun.  However, when I started learning about web development, this seemed cast aside.  Instead, we're told to use one URL with GET and POST calls, which seems really odd.</p>
  
  <p>So imagine I have a <code>Person</code> object and I want to update their age.  In the non-HTTP world, you're supposed to have a method called <code>&lt;PersonObject&gt;.getAge()</code> and another method called <code>&lt;PersonObject&gt;.setAge(int newAge)</code>.  But say, instead, you've got a webserver that holds user profile information.  According to HTTP conventions, you'd have a URL like '/account/age'.  To get their age, you'd request that URL with a 'GET', and to set their age, you'd request that URL with a 'POST' and somehow (form, JSON, URL-arg, etc.) send the new value along.</p>
  
  <p>The HTTP method just feels awkward.  To me, that's analogous to changing the non-HTTP version to one method called <code>age</code>, and you'd get their age with <code>&lt;PersonObject&gt;.age('GET')</code>, and set their age with <code>&lt;PersonObject&gt;.age(newAge, 'SET')</code>.  Why is it done that way?  </p>
  
  <p>Why not have one URL called '/account/getAge' and another called '/account/setAge'?</p>