anchor.diff:  %% Internal functions
   %%------------------------------------------------------------------------------
   
  +-spec open_conn(list(), list(tuple)) -> pid().
   open_conn(Endpoint, SSlOpts) ->
       {ok, Connection} = gun:open(Endpoint, 443,
                                   #{transport => ssl, transport_opts => SSlOpts}),
       {ok, _} = gun:await_up(Connection),
       Connection.
   
  +-spec receive_token(pid(), map()) -> {ok, token()} | any().
   receive_token(Connection, #{app_key := Appkey} = Credentials) ->
       ReqBody = betfair_http:url_encode(maps:without([app_key], Credentials)),
       ReqHeaders = [{<<"Content-Type">>, "application/x-www-form-urlencoded"},
  
positive.code: start_link() ->
      supervisor:start_link({local, ?SERVER}, ?MODULE, []).
  
  start_session(Opts) ->
      Credentials = proplists:get_value(credentials, Opts),
      SSlOpts = proplists:get_value(ssl, Opts),
  
negative.code: 
      case supervisor:start_child(?MODULE,  ChildSpec) of
          {ok, _P} = Pid -> Pid;
          {error, {already_started, P}} -> P;
          {error, _Reason} = Error -> Error
      end.
  
  