ex_aliyun_openapi v0.7.1 ExAliyun.OpenAPI View Source
Functions to call Aliyun OpenAPI.
- You can just put addition args.
- You can find the api params in Official Link.
Link to this section Summary
Functions
Aliyun Authenticate Sig Service(人机验证). You can read the doc in Official Link.
Aliyun Project Task Service of CodeUp (云效任务管理). You can read the doc in Official Link.
Aliyun Cloud Push Service(移动推送). You can read the doc in Official Link.
Global Aliyun Short Message Service(国际短信服务). You can read the doc in Official Link.
Aliyun Short Message Service(短信服务). You can read the doc in Official Link.
Aliyun Security Token Service(短期访问权限). You can read the doc in Official Link.
Perform a POST request.
Perform a POST request.
Perform a request.
Perform request and raise in case of error.
Link to this section Types
option()
View Source
option() ::
{:method, Tesla.Env.method()}
| {:url, Tesla.Env.url()}
| {:query, Tesla.Env.query()}
| {:headers, Tesla.Env.headers()}
| {:body, Tesla.Env.body()}
| {:opts, Tesla.Env.opts()}
option() :: {:method, Tesla.Env.method()} | {:url, Tesla.Env.url()} | {:query, Tesla.Env.query()} | {:headers, Tesla.Env.headers()} | {:body, Tesla.Env.body()} | {:opts, Tesla.Env.opts()}
Link to this section Functions
call_afs(params, access_info \\ nil) View Source
Aliyun Authenticate Sig Service(人机验证). You can read the doc in Official Link.
call_codeup(params, access_info \\ nil) View Source
Aliyun Project Task Service of CodeUp (云效任务管理). You can read the doc in Official Link.
call_cps(params, access_info \\ nil) View Source
Aliyun Cloud Push Service(移动推送). You can read the doc in Official Link.
call_global_sms(params, access_info \\ nil) View Source
Global Aliyun Short Message Service(国际短信服务). You can read the doc in Official Link.
call_sms(params, access_info \\ nil) View Source
Aliyun Short Message Service(短信服务). You can read the doc in Official Link.
call_sts(params, access_info \\ nil) View Source
Aliyun Security Token Service(短期访问权限). You can read the doc in Official Link.
get_access_info(service) View Source
get_timestamp() View Source
post(client, url, body, opts)
View Source
post(Tesla.Env.client(), Tesla.Env.url(), Tesla.Env.body(), [option()]) ::
Tesla.Env.result()
post(Tesla.Env.client(), Tesla.Env.url(), Tesla.Env.body(), [option()]) :: Tesla.Env.result()
Perform a POST request.
See request/1
or request/2
for options definition.
post("/users", %{name: "Jon"})
post("/users", %{name: "Jon"}, query: [scope: "admin"])
post(client, "/users", %{name: "Jon"})
post(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
post!(client, url, body, opts)
View Source
post!(Tesla.Env.client(), Tesla.Env.url(), Tesla.Env.body(), [option()]) ::
Tesla.Env.t() | no_return()
post!(Tesla.Env.client(), Tesla.Env.url(), Tesla.Env.body(), [option()]) :: Tesla.Env.t() | no_return()
Perform a POST request.
See request!/1
or request!/2
for options definition.
post!("/users", %{name: "Jon"})
post!("/users", %{name: "Jon"}, query: [scope: "admin"])
post!(client, "/users", %{name: "Jon"})
post!(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
request(client \\ %Tesla.Client{}, options)
View Source
request(Tesla.Env.client(), [option()]) :: Tesla.Env.result()
request(Tesla.Env.client(), [option()]) :: Tesla.Env.result()
Perform a request.
Options
:method
- the request method, one of [:head, :get, :delete, :trace, :options, :post, :put, :patch]:url
- either full url e.g. "http://example.com/some/path" or just "/some/path" if usingTesla.Middleware.BaseUrl
:query
- a keyword list of query params, e.g.[page: 1, per_page: 100]
:headers
- a keyworld list of headers, e.g.[{"content-type", "text/plain"}]
:body
- depends on used middleware:- by default it can be a binary
- if using e.g. JSON encoding middleware it can be a nested map
- if adapter supports it it can be a Stream with any of the above
:opts
- custom, per-request middleware or adapter options
Examples
ExampleApi.request(method: :get, url: "/users/path")
# use shortcut methods
ExampleApi.get("/users/1")
ExampleApi.post(client, "/users", %{name: "Jon"})
request!(client \\ %Tesla.Client{}, options)
View Source
request!(Tesla.Env.client(), [option()]) :: Tesla.Env.t() | no_return()
request!(Tesla.Env.client(), [option()]) :: Tesla.Env.t() | no_return()
Perform request and raise in case of error.
This is similar to request/2
behaviour from Tesla 0.x
See request/2
for list of available options.