anchor.diff:  
   -record(state, { client_id,          % Tuple client ID for HTTP requests
                    base_urls,          % Tuple of #url -- one for each IP
  -                 base_urls_index }). % #url to use for next request
  +                 base_urls_index,    % #url to use for next request
  +                 path_params }).     % Params to append on the path
   
   %% ====================================================================
   %% API
  
positive.code:     { element(State#state.base_urls_index, State#state.base_urls),
        State#state { base_urls_index = State#state.base_urls_index + 1 }}.
  
  do_get(BaseUrl, KeyGen) ->
      Url = BaseUrl#url { path = lists:concat([BaseUrl#url.path, '/', KeyGen()]) },
      case send_request(Url, [], get, [], [{response_format, binary}]) of
          {ok, "404", _Headers, _Body} ->
              {not_found, Url};
  
negative.code:     {error, max_retries};
  send_request(Url, Headers, Method, Body, Options, Count) ->
      Pid = connect(Url),
      case catch(ibrowse_http_client:send_req(Pid, Url, Headers, Method, Body, Options, 5000)) of
          {ok, Status, RespHeaders, RespBody} ->
              {ok, Status, RespHeaders, RespBody};
  
          Error ->
              disconnect(Url),
              case should_retry(Error) of
                  true ->
                      send_request(Url, Headers, Method, Body, Options, Count-1);
  
                  false ->
                      normalize_error(Method, Error)
              end
      end.
  
  
  should_retry({error, send_failed})       -> true;
  should_retry({error, connection_closed}) -> true;
  should_retry({'EXIT', {normal, _}})      -> true;
  should_retry({'EXIT', {noproc, _}})      -> true;
  should_retry(_)                          -> false.
  
  normalize_error(Method, {'EXIT', {timeout, _}})  -> {error, {Method, timeout}};
  normalize_error(Method, {'EXIT', Reason})        -> {error, {Method, 'EXIT', Reason}};
  normalize_error(Method, {error, Reason})         -> {error, {Method, Reason}}.
  