anchor.diff:      Pid ! {body_part, self(), http_eob},
       read_response(Pid, Timeout).
   
  +%% @spec (State :: State, Trailers) -> Result
  +%%   State = {pid(), Window}
  +%%   Window = non_neg_integer() | infinity 
  +%%   Header = string() | binary() | atom()
  +%%   Value = string() | binary()
  +%%   Result = {ok, {{StatusCode, ReasonPhrase}, Hdrs, ResponseBody}}
  +%%            | {error, Reason}
  +%%   Reason = connection_closed | connect_timeout | timeout
  +%% @doc Sends trailers to an ongoing request using the default timeout infinity.
  +%% It is the same as calling `send_trailers(State, BodyPart, infinity)'.
  +%% @end
   -spec send_trailers({pid(), window_size()}, headers()) -> result().
   send_trailers({Pid, Window}, Trailers) ->
       send_trailers({Pid, Window}, Trailers, infinity).
   
  +%% @spec (State :: State, Trailers, Timeout) -> Result
  +%%   State = {pid(), Window}
  +%%   Window = non_neg_integer() | infinity 
  +%%   Trailers = [{Header, Value}]
  +%%   Header = string() | binary() | atom()
  +%%   Value = string() | binary()
  +%%   Timeout = integer() | infinity
  +%%   Result = {ok, {{StatusCode, ReasonPhrase}, Hdrs, ResponseBody}}
  +%%            | {error, Reason}
  +%%   Reason = connection_closed | connect_timeout | timeout
  +%% @doc Sends trailers to an ongoing request.
  +%% `Timeout' is the timeout for the request in milliseconds.
  +%%
  +%% If the window size reaches 0 the call will block for at maximum Timeout
  +%% milliseconds. If there is no acknowledgement received during that time the
  +%% the request is cancelled and client process is killed.
  +%%
  +%% Trailers can only be send with requests where "chunked" `Transfer=Encoding'
  +%% is specified.
  +%%
  +%% Sending the trailers finishes the request then the response is read and
  +%% returned.
  +%% @end
   -spec send_trailers({pid(), window_size()}, [{string() | string()}], 
           timeout()) -> result().
   send_trailers({Pid, _Window}, Trailers, Timeout)
  
positive.code:             erlang:error(Reason)
      end.
  
  -spec send_body_part({pid(), window_size()}, binary()) -> 
          {pid(), window_size()} | result().
  send_body_part({Pid, Window}, Bin) ->
      send_body_part({Pid, Window}, Bin, infinity).
  
  -spec send_body_part({pid(), window_size()}, binary(), timeout()) -> 
          {ok, {pid(), window_size()}} | result().
  send_body_part({Pid, 0}, Bin, Timeout) 
  
negative.code: %% `{send_retry, N}' specifies how many times the client should retry
  %% sending a request if the connection is closed after the data has been
  %% sent. The default value is 1.
  %%
  %% `{partial_upload, N}' specifies how many body parts can be sent to the
  %% client handling the request without waiting for an acknowledgement. 
  %% N can be infinity as well meaning that waiting for acknowledgements is not
  %% required. If partial_upload is specified and the `Content-Length' is not 
  %% provided in the headers "chunked" `Transfer-Encoding' is used for sending
  %% the body parts.
  %% @end
  -spec request(string(), string() | atom(), headers(), iolist(),
          pos_integer() | infinity, [option()]) -> result().
  