Skip to content

Commit 0df8d70

Browse files
committed
Fix multipart/form-data HTTP example
1 parent 058c94d commit 0df8d70

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

templates/http/docs/example.md.twig

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
{% set boundary = random() %}
12
{{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1
2-
Host: {{spec.host}}
3+
Host: {{ spec.host }}
34
{% for key, header in method.headers %}
4-
{{ key }}: {{ header }}
5+
{{ key }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%}
56
{% endfor %}
67
{% for key,header in spec.global.defaultHeaders %}
7-
{{key}}: {{header}}
8+
{{ key }}: {{ header }}
89
{% endfor %}
910
{% for header in spec.global.headers %}
1011
{% if header.key != 'Mode' and header.key != 'Locale' %}
11-
{{header.name}}: {% for node in method.security %}{% for key,x in node|keys %}{% if x == header.key %}{{node[x]['x-appwrite']['demo']}}{% endif %}{% endfor %}{% endfor %}
12-
12+
{{ header.name }}: {% for node in method.security %}{% for key,x in node|keys %}{% if x == header.key %}{{node[x]['x-appwrite']['demo']}}{% endif %}{% endfor %}{% endfor ~%}
1313
{% endif %}
1414
{% endfor %}
15-
1615
{% for key, header in method.headers %}
1716
{% if header == 'application/json' %}
17+
1818
{% if method.parameters.body %}
1919
{
2020
{% for parameter in method.parameters.body %}
@@ -25,9 +25,8 @@ Host: {{spec.host}}
2525
{% endif %}
2626
{% endif %}
2727
{% if header == 'multipart/form-data' %}
28-
{% set boundary = random() %}
29-
boundary={{boundary}}
3028
Content-Length: *Length of your entity body in bytes*
29+
3130
{% for parameter in method.parameters.body %}
3231
--{{boundary}}
3332
Content-Disposition: form-data; name="{{parameter.name}}{% if parameter.type == "array" %}[]{% endif %}"

0 commit comments

Comments
 (0)