anchor.diff:  ?PASSTHROUGH(socket).
   
   request_method(Wrapper) ->
  -	Mod = Wrapper#sbw.mod,
  -	Req = Wrapper#sbw.req,
  +    Mod = Wrapper#sbw.mod,
  +    Req = Wrapper#sbw.req,
       case Mod:request_method(Req) of
           Method when is_binary(Method) ->
               list_to_atom(binary_to_list(Method));
  
positive.code:     post_param_group(Param, [], Wrapper).
  
  post_param_group(Param, DefaultValue, Wrapper) ->
  	find_param_group(Param, DefaultValue, post_params(Wrapper)).
  
  %% QUERY PARAMS
  
  query_params(Wrapper) ->
  	Wrapper#sbw.query_params.
  
  query_param(Param, Wrapper) ->
      query_param(Param, undefined, Wrapper).
  
  query_param(Param, DefaultValue, Wrapper) ->
  	find_param(Param, DefaultValue, query_params(Wrapper)).
  
  %% POST PARAMS
  
  post_params(Wrapper) ->
  	Wrapper#sbw.post_params.
  
  post_param(Param, Wrapper) ->
      post_param(Param, undefined, Wrapper).
  
  post_param(Param, DefaultValue, Wrapper) ->
  	find_param(Param, DefaultValue, post_params(Wrapper)).
  
  %% AGNOSTIC PARAMS
  
  params(Wrapper) ->
  	post_params(Wrapper) ++ query_params(Wrapper).
  
  param(Param, Wrapper) ->
      param(Param, undefined, Wrapper).
  
  param(Param, DefaultValue, Wrapper) ->
  	case post_param(Param, Wrapper) of
  		undefined -> query_param(Param, DefaultValue, Wrapper);
  		V -> V
  	end.
  
  %% FIND PARAM
  
  find_param(Param, Default, ParamList) when is_binary(Param) ->
  	case lists:keyfind(Param, 1, ParamList) of
  		{_, Val} -> Val;
  		false -> Default
  	end;
  find_param(Param, Default, ParamList) when is_atom(Param); is_list(Param) ->
  	Param1 = simple_bridge_util:to_binary(Param),
  	simple_bridge_util:to_list(find_param(Param1, Default, ParamList)).
  
  
  find_param_group(Param, Default, ParamList) when is_binary(Param) ->
  	case [V || {K,V} <- ParamList, K=:=Param] of
  		[] -> Default;
  		L -> L
  	end;
  find_param_group(Param, Default, ParamList) when is_list(Param); is_atom(Param) ->
  	Param1 = simple_bridge_util:to_list(Param),
  	ResultList = find_param_group(Param1, Default, ParamList),
  	[simple_bridge_util:to_list(V) || V <- ResultList].
  
  %% DEEP PARAM STUFF
  
  deep_params(Wrapper) ->
  	Params = params(Wrapper),
  	parse_deep_post_params(Params, []).
  
  deep_param(Path, Wrapper) ->
  	find_deep_post_param(Path, deep_params(Wrapper)).
  
  deep_query_params(Wrapper) ->
  	Params = query_params(Wrapper),
  	parse_deep_post_params(Params, []).
  
  deep_query_param(Path, Wrapper) ->
  	find_deep_post_param(Path, deep_query_params(Wrapper)).
  
  deep_post_params(Wrapper) ->
      Params = post_params(Wrapper),
  
negative.code: % vim: ts=4 sw=4 et
  % Simple Bridge
  % Copyright (c) 2008-2010 Rusty Klophaus
  % Copyright (c) 2013 Jesse Gumm
  