anchor.diff:  %%% @end
   -module(lhttpc_lib).
   
  --export([parse_url/1, format_request/5, header_value/2, header_value/3]).
  +-export([parse_url/1, format_request/6, header_value/2, header_value/3]).
   -export([maybe_atom_to_list/1]).
   
   -export([format_hdrs/1]).
  
positive.code:         _ -> % We have a host
              Hdrs
      end.
  
negative.code: split_port(Scheme, [P | T], Port) ->
      split_port(Scheme, T, [P | Port]).
  
  %% @spec (Path, Method, Headers, Host, Body, PartialUpload) -> Request
  %% Path = iolist()
  %% Method = atom() | string()
  %% Headers = [{atom() | string(), string()}]
  %% Host = string()
  %% Body = iolist()
  %% PartialUpload = true | false
  -spec format_request(iolist(), atom() | string(), headers(), string(),
      iolist(), true | false ) -> {true | false, iolist()}.
  format_request(Path, Method, Hdrs, Host, Body, PartialUpload) ->
      FormatedMethod = format_method(Method),
      AllHdrs = add_mandatory_hdrs(
                     FormatedMethod, Hdrs, Host, Body, PartialUpload),
      {is_chunked(AllHdrs),
      [
          FormatedMethod, " ", Path, " HTTP/1.1\r\n",
          format_hdrs(AllHdrs),
          Body
      ]}.
  
  format_method(Method) when is_atom(Method) ->
      string:to_upper(atom_to_list(Method));
  