for-GET / katt

KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang.
https://github.com/for-GET/katt
Apache License 2.0
119 stars 16 forks source link

Possibility to give hackney options #80

Closed brucify closed 3 years ago

brucify commented 3 years ago

Possibility to give hackney:request/5 additional options, without having to give a whole function in to replace {request, ?DEFAULT_REQUEST_FUN}.

Currently ?DEFAULT_REQUEST_FUN is hardcoded to use two specific options when calling hackney:request/5.

-define(DEFAULT_REQUEST_FUN,        fun katt_callbacks:request/3).

In katt_util.erl:

external_http_request(Url, Method, Hdrs, Body, Timeout, []) ->
  ...
  Options = [ {recv_timeout, Timeout}
            , {insecure, true}
            ],
  case hackney:request(Method, BUrl, BHdrs, Body, Options) of