Adding check to make sure headers are passed on POST requests
Test to check the url parameters sent on the POST request are the correct ones. Using PrintWriter instead DataOutputStream to avoid having to use final method write
Moved the creation of the APIReader overriding the createWriter to the only test where it is needed
Renamed method to keep consistency on the class and be more explicit by saying the HTTP method
Refactoring: extracting duplicated functionality to a private method
Refactoring: reformatting and renaming exception variable
Adding test to make sure we clear internal variable lastHttpResult for the response. We should get rid of this variable if we do not really need it
Adding test to make sure we clear internal variable lastHttpResult for the response when firing a POST requst.
Moving the clear lastHttpResponse private method into the getFetchedResults private method. We want to hide this low level stuff from top level public methods
Adding FIXME note, we should migrate all the client code using APIReader constructors to use the new constructor taking URL as the type of the parameter
Refactoring: extracted method to prepare the GET request
Refactoring: extracted method to set request properties
Refactoring: extracted duplication to set request properties. Extracted method to prepare POST requests