Utility code to make it easier to do REST in PHP.