anchor.diff:  insecure |
   %% to pass ssl options to ssl2
   {ssl_options, [term()]} |
  -%% specifying maximum body length that can be automatically returned
  -%% from request. In case of a large body, function request_return_stream/5
  +%% Specifying maximum body length that can be automatically returned
  +%% from request. By default, whole body is returned regardless of its size.
  +%% NOTE: in case of a large body, function request_return_stream/5
   %% can be used to stream the body.
   {max_body, integer()} |
   %% the response messages will be sent to this PID
  
positive.code:     ReqBd :: body(), Options :: opts()) ->
      {ok, code(), headers(), body()} | {error, term()}.
  request(Method, URL, ReqHdrs, ReqBd, Options) ->
      % If max_body is specified in opts, don't modify it, else use default
      MaxBd = proplists:get_value(max_body, Options, ?MAX_BODY_LENGTH),
      % with_body option forces hackney to always return the body
      Opts = [with_body, {max_body, MaxBd} | proplists:delete(max_body, Options)],
      do_request(Method, URL, ReqHdrs, ReqBd, Opts).
  
negative.code: % Opts passed to hackney
  -type hackney_opts() :: [term()].
  
  %% API - convenience functions
  -export([get/1, get/2, get/3, get/4]).
  -export([post/1, post/2, post/3, post/4]).
  