ExWechatpay.Http protocol (ex_wechatpay v0.3.5)
View SourceHTTP 请求处理协议
该协议定义了执行 HTTP 请求的接口。 通过实现该协议,可以支持不同的 HTTP 客户端库。 目前默认使用 Finch 作为 HTTP 客户端。
Summary
Functions
执行 HTTP 请求
Types
@type t() :: term()
All the types that implement this protocol.
Functions
@spec do_request( http :: t(), req :: ExWechatpay.Model.Http.Request.t() ) :: ExWechatpay.Typespecs.result_t(ExWechatpay.Model.Http.Response.t())
执行 HTTP 请求
参数
http- HTTP 客户端实例req- HTTP 请求
返回值
{:ok, Response.t()}- 请求成功的响应{:error, Exception.t()}- 请求失败的错误信息