{%- import "helper/code.html" as code %} {%- import "helper/util.html" as util %}
Sample:
Request:
{{- "" -}} {%- if method_sample.method|lower == 'http' -%} GET {%- else -%} {{ method_sample.method|upper }} {%- endif -%} {{- code.uri_sampled(method_sample.absolute_uri, method_sample.request_parameters) -}} HTTP/1.1 Content-Type: application/json; charset=utf-8 {%- for parameter in method_sample.request_headers %} {{ parameter.name }}: {{ util.none_to_empty(parameter.sample) }} {%- endfor -%} {{- " " -}} {%- if method_sample.request_body -%} {{ code.code_sampled(method_sample.request_body) -}} {%- endif -%}
Response:
{{- "" -}} HTTP/1.1 {{ method_sample.code }} {{ method_sample.message }} Content-Type: application/json; charset=utf-8 {{- " " -}} {%- if method_sample.response_body -%} {{ code.code_sampled(method_sample.response_body) -}} {%- endif -%}