瀏覽代碼

Fix to allow functions to be passed as body. Thanks to http://github.com/benoitc

pull/16/head
Chandrashekhar Mullaparthi 16 年之前
父節點
當前提交
2e0889e70a
共有 1 個檔案被更改,包括 5 行新增4 行删除
  1. +5
    -4
      src/ibrowse.erl

+ 5
- 4
src/ibrowse.erl 查看文件

@ -372,10 +372,11 @@ do_send_req(Conn_Pid, Parsed_url, Headers, Method, Body, Options, Timeout) ->
Ret
end.
ensure_bin(L) when is_list(L) ->
list_to_binary(L);
ensure_bin(B) when is_binary(B) ->
B.
ensure_bin(L) when is_list(L) -> list_to_binary(L);
ensure_bin(B) when is_binary(B) -> B;
ensure_bin(Fun) when is_function(Fun) -> Fun;
ensure_bin({Fun}) when is_function(Fun) -> Fun;
ensure_bin({Fun, _} = Body) when is_function(Fun) -> Body.
%% @doc Creates a HTTP client process to the specified Host:Port which
%% is not part of the load balancing pool. This is useful in cases

Loading…
取消
儲存