anchor.diff:              Language = z_convert:to_list(proplists:get_value(language, Opts, en)),
               Accept = z_convert:to_list(proplists:get_value(accept, Opts, ?HTTP_ACCEPT)),
               UserAgent = z_convert:to_list(proplists:get_value(user_agent, Opts, httpc_ua(Url))),
  +            ContentType = case proplists:get_value(content_type, Opts) of
  +                undefined -> "application/octet-stream";
  +                CT -> to_list(CT)
  +            end,
               Headers = [
                   {"Accept", Accept},
                   {"Accept-Encoding", "identity"},
  
positive.code: 
  -export([
      fetch/2,
      fetch_partial/1,
      fetch_partial/2,
  
      profile/1,
      ensure_profiles/0,
  
negative.code:     option/0
  ]).
  
  -define(is_method(M), (M =:= get orelse M =:= post orelse M =:= delete orelse M =:= put orelse M =:= patch)).
  
  %% @doc Fetch the data and headers from an url
  -spec fetch(Url, Options) -> fetch_result() when
      Url :: string() | binary(),
      Options :: options().
  fetch(Url, Options) ->
      fetch_partial(get, Url, <<>>, Options).
  
  %% @doc Fetch the data and headers from an url
  -spec fetch(Method, Url, Payload, Options) -> fetch_result() when
      Method :: get | post | put | delete | patch,
      Url :: string()|binary(),
      Payload :: binary(),
      Options :: options().
  fetch(Method, Url, Payload, Options) when is_binary(Payload), ?is_method(Method) ->
      fetch_partial(Method, Url, Payload, Options).
  
  
  %% @doc Fetch the first kilobytes of data and headers from an url
  -spec fetch_partial(Url) -> fetch_result() when
      Url :: string() | binary().
  fetch_partial(Url) ->
      fetch_partial(get, Url, <<>>, [{max_length, ?HTTPC_LENGTH}]).
  
  %% @doc Fetch the first N bytes of data and headers from an url, optionally save to the file device
  -spec fetch_partial(Url, Options) -> fetch_result() when
      Url :: string() | binary(),
      Options :: options().
  fetch_partial("data:" ++ _ = DataUrl, Options) ->
      fetch_data_url(DataUrl, Options);
  fetch_partial(<<"data:", _/binary>> = DataUrl, Options) ->
      fetch_data_url(DataUrl, Options);
  fetch_partial(Url, Options) ->
      fetch_partial(get, Url, <<>>, Options).
  
  %% @doc Fetch the first N bytes of data and headers from an url, optionally save to the file device
  -spec fetch_partial(Method, Url, Payload, Options) -> fetch_result() when
      Method :: get | post | delete | put | patch,
      Url :: string()|binary(),
      Payload :: binary(),
      Options :: options().
  fetch_partial(Method, Url, Payload, Options) when is_binary(Payload), ?is_method(Method) ->
      OutDevice = proplists:get_value(device, Options),
      MaxLength = proplists:get_value(max_length, Options, ?HTTPC_MAX_LENGTH),
      fetch_partial(Method, z_convert:to_list(Url), Payload, 0, MaxLength, OutDevice, Options).
  
  
  -spec ensure_profiles() -> ok.
  