{% extends "base.html" %} {% block content %}

API Documentation

When using the harness as a JSON API, all requests must specify the Content-Type headers as 'application/json'. It is also possible to script the normal form endpoints, but the response will be HTML, so this is not recommended.

Parameters

Input parameters

    {% for f in req_fields %}
  • {{ f }}
  • {% endfor %}

Output parameters

    {% for f in output_fields %}
  • {{ f }}
  • {% endfor %}

Flags

    {% for f in flags %}
  • {{ f }}
  • {% endfor %}

Usage Information

Single Endpoint Usage:
curl -X POST http://localhost:5000/single -H "Content-Type: application/json" -d '{
    {% for f in req_fields -%}
    "{{ f }}": "{{ numbers[loop.index-1] }}"{% if loop.index < req_fields|length -%},
    {% else %}
{% endif -%}
{% endfor -%}
}'
                        

{
    {% for f in req_fields -%}
    "{{ f }}": {{ numbers[loop.index-1] }},
    {% endfor -%}
    "flags": []
}
                        
Batch Endpoint Usage:
curl -X POST http://localhost:5000/single -H "Content-Type: application/json" -d '{
    "items": [
        {
            {% for f in req_fields -%}
            "{{ f }}": "{{ numbers[loop.index-1] }}"{% if loop.index < req_fields|length -%},
            {% else %}
        {% endif -%}
            {% endfor -%}
        },
        {
            {% for f in req_fields -%}
            "{{ f }}": "{{ numbers[loop.index-1+req_fields|length] }}"{% if loop.index < req_fields|length -%},
            {% else %}
        {% endif -%}
            {% endfor -%}
        }
    ]
}'
                        

{
    "items": [
        {
            {% for f in req_fields -%}
            "{{ f }}": {{ numbers[loop.index-1] }},
            {% endfor -%}
            "flags": []
        },
        {
            {% for f in req_fields -%}
            "{{ f }}": {{ numbers[loop.index-1+req_fields|length] }},
            {% endfor -%}
            "flags": []
        }
    ]
}
                        
{% endblock %}