ExWechatpay.Http protocol (ex_wechatpay v0.3.5)

View Source

HTTP 请求处理协议

该协议定义了执行 HTTP 请求的接口。 通过实现该协议,可以支持不同的 HTTP 客户端库。 目前默认使用 Finch 作为 HTTP 客户端。

Summary

Types

t()

All the types that implement this protocol.

Functions

执行 HTTP 请求

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

do_request(http, req)

执行 HTTP 请求

参数

  • http - HTTP 客户端实例
  • req - HTTP 请求

返回值

  • {:ok, Response.t()} - 请求成功的响应
  • {:error, Exception.t()} - 请求失败的错误信息