anchor.diff:                #{stream := StreamRef, from := From} = State) ->
       gen_fsm:reply(From, {ok, StreamRef}),
       {next_state, wait_response, State};
  -wait_response({data, Data, FinNoFin},
  -              #{stream := StreamRef, pid := Pid} = State) ->
  -    ok = gun:data(Pid, StreamRef, FinNoFin, Data),
  -    {next_state, wait_response, State};
   wait_response(Event, State) ->
       {stop, {unexpected, Event}, State}.
  -
  -%% @private
  --spec receive_data(term(), pid(), term()) -> term().
  -receive_data(Event, From, State) ->
  -    enqueue_work_or_stop(receive_data, Event, From, State).
   
   %% @private
   %% @doc Regular response
  
positive.code: %% @doc Performs a request to <code>Uri</code> using the HTTP method
  %% specified by <code>Method</code>,  <code>Body</code> as the content data and
  %% <code>Headers</code> as the request's headers.
  -spec request(pid(), http_verb(), iodata(), headers(), iodata(), options()) ->
      result().
  request(Pid, get, Uri, Headers0, Body, Options) ->
      try
  
negative.code: %% gen_fsm states
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  %% @private
  -spec at_rest(term(), pid(), term()) -> term().
  at_rest({data, _, _} = Event, _From, State) ->
      unexpected_event_warning(at_rest, Event),
      {reply, {error, unexpected}, at_rest, State};
  at_rest(Event, From, State) ->
      enqueue_work_or_stop(at_rest, Event, From, State).
  
  %% @private
  -spec wait_response(term(), pid(), term()) -> term().
  wait_response( {data, Data, FinNoFin}
               , _From
               , #{stream := StreamRef, pid := Pid} = State) ->
      ok = gun:data(Pid, StreamRef, FinNoFin, Data),
      {reply, ok, wait_response, State};
  wait_response(Event, From, State) ->
      enqueue_work_or_stop(wait_response, Event, From, State).
  
  %% @private
  -spec receive_data(term(), pid(), term()) -> term().
  receive_data({data, _, _} = Event, _From, State) ->
      unexpected_event_warning(at_rest, Event),
      {reply, {error, unexpected}, receive_data, State};
  receive_data(Event, From, State) ->
      enqueue_work_or_stop(receive_data, Event, From, State).
  
  %% @private
  -spec receive_chunk(term(), pid(), term()) -> term().
  receive_chunk({data, _, _} = Event, _From, State) ->
      unexpected_event_warning(at_rest, Event),
      {reply, {error, unexpected}, receive_chunk, State};
  receive_chunk(Event, From, State) ->
      enqueue_work_or_stop(receive_chunk, Event, From, State).
  
  %See if we have work. If we do, dispatch.
  %If we don't, stay in at_rest.
  %% @private
  -spec at_rest(any(), state()) -> {next_state, atom(), state()}.
  at_rest(timeout, State) ->
      case get_work(State) of
          no_work ->
              {next_state, at_rest, State};
  