View Source ExWechatpay.Http.Request (ex_wechatpay v0.1.5)

http request



create new http request instance


Link to this type


View Source
@type http_request_schema_t() :: [
  scheme: binary(),
  host: binary(),
  port: integer(),
  method: term(),
  path: binary(),
  headers: [term()],
  body: term(),
  params: %{optional(binary()) => binary()},
  opts: keyword()
@type t() :: %ExWechatpay.Http.Request{
  body: ExWechatpay.Typespecs.body(),
  headers: ExWechatpay.Typespecs.headers(),
  host: String.t(),
  method: ExWechatpay.Typespecs.method(),
  opts: ExWechatpay.Typespecs.opts(),
  params: ExWechatpay.Typespecs.params(),
  path: bitstring(),
  port: non_neg_integer(),
  scheme: String.t()


@spec new(http_request_schema_t()) :: t()

create new http request instance


  • :scheme (String.t/0) - http scheme The default value is "https".

  • :host (String.t/0) - Required. http host

  • :port (integer/0) - http port The default value is 443.

  • :method (term/0) - http method The default value is :get.

  • :path (String.t/0) - http path The default value is "/".

  • :headers (list of term/0) - http headers The default value is [].

  • :body (term/0) - http body The default value is nil.

  • :params (map of String.t/0 keys and String.t/0 values) - http query params The default value is %{}.

  • :opts (keyword/0) - http opts The default value is [].

@spec url(t()) :: URI.t()