alef 0.70.0

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
base_url = System.get_env("MOCK_SERVER_URL") || "http://localhost:8000"

{:ok, response} =
  Req.request(
    method: :{{ method }},
    url: base_url <> "{{ path }}"{% if headers or body %},{% endif %}
{% if headers %}
    headers: [
{% for header in headers %}
      {"{{ header.key }}", "{{ header.value }}"},
{% endfor %}
    ]{% if body %},{% endif %}
{% endif %}
{% if body %}
    {{ "body" if raw_body else "json" }}: {{ body }}
{% endif %}
  )