{%if context.title%}
{{ context.title|safe }}
------------------------
{%endif%}

{%if context.desc%}
{{ context.desc|safe }}
{% endif %}

{% for http_desc in context.method %}
{% set http_method = {{http_desc.method}} %}

.. http:{{ http_method |method_wrapper|safe }}:: {{ http_desc.path|safe }}

   {{http_desc.desc|indent(3)}}

   **{{base.rest_api_http_request_example_title}}**:

   .. sourcecode:: http

      {{http_method|upper}} {{ http_desc.path|safe }}  HTTP/1.1
      Host: {{base.http_domain}}
      Accept: application/json, text/javascript

      {% if http_method.upper() == 'POST' or  http_method.upper() == 'PUT' %}
      {{http_desc.request|indent(6)}}
      {%endif%}

   **{{base.rest_api_http_response_example_title}}**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: text/javascript

      {{http_desc.response|indent(6)}}

   {%for param_name,desc in http_desc.params.items() %}
   :query {{param_name}}: {{desc|safe}}
   {%endfor%}

   {%for header_name,desc in http_desc.headers.items() %}
   :reqheader {{header_name}}: {{desc|safe}}
   {%endfor%}

   {%for header_name,desc in http_desc.codes.items() %}
   :statuscode {{header_name}}: {{desc|safe}}
   {%endfor%}

{% endfor %}