-
Notifications
You must be signed in to change notification settings - Fork 12
/
curl.mustache
37 lines (37 loc) · 1.42 KB
/
curl.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{#request.name}}## {{{request.name}}}
{{/request.name}}{{#request.cURLDescription}}
{{{request.cURLDescription}}}
{{/request.cURLDescription}}curl {{#request_is_head}}--head {{/request_is_head}}{{#specify_method}}-X "{{{request.method}}}" {{/specify_method}}"{{{request.url}}}" \
{{#headers.has_headers}}
{{#headers.header_list}}
-H '{{{header_name}}}: {{{header_value}}}' \
{{/headers.header_list}}
{{/headers.has_headers}}
{{#headers.auth}}
-u '{{{headers.auth.username}}}:{{{headers.auth.password}}}' {{#headers.auth.isDigest}}--digest{{/headers.auth.isDigest}}\
{{/headers.auth}}
{{! ----- }}
{{#body.has_url_encoded_body}}
{{#body.url_encoded_body}}
--data-urlencode "{{{name}}}={{{value}}}" \
{{/body.url_encoded_body}}
{{/body.has_url_encoded_body}}
{{! ----- }}
{{#body.has_raw_body_with_tabs_or_new_lines}}
-d $'{{{body.raw_body}}}' \
{{/body.has_raw_body_with_tabs_or_new_lines}}
{{! ----- }}
{{#body.has_raw_body_without_tabs_or_new_lines}}
-d "{{{body.raw_body}}}" \
{{/body.has_raw_body_without_tabs_or_new_lines}}
{{! ----- }}
{{#body.has_long_body}}
-d "{set your body string}" \
{{/body.has_long_body}}
{{! ----- }}
{{#body.has_multipart_body}}
{{#body.multipart_body}}
-F "{{{name}}}={{{value}}}" \
{{/body.multipart_body}}
{{/body.has_multipart_body}}
{{! ----- }}