API Usage

Using GET

With params

curl -X GET "https://test-case-generator.herokuapp.com/api?function_name=random_number&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1"

With accept header

curl -X GET -H "Accept: application/xml" "https://test-case-generator.herokuapp.com/api?function_name=random_number&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1"

JSON-P support

curl -X GET "https://test-case-generator.herokuapp.com/api?function_name=random_number&callback=console.log&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1"

Data only

Using wget

wget -O file.in "https://test-case-generator.herokuapp.com/api?function_name=random_number&only_data_flag=true&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1"

Using curl

curl -X GET "https://test-case-generator.herokuapp.com/api?function_name=random_number&only_data_flag=true&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1" > out.txt

Using POST

With params

curl -X POST "https://test-case-generator.herokuapp.com/api?function_name=random_number&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1"

With fields:

curl -X POST -d "function_name=random_number&n_test_cases=10&min_value=1&max_value=10&include_n_test_cases_flag=1" "https://test-case-generator.herokuapp.com/api"

Multipart

curl -X POST --form "function_name=random_number" --form "n_test_cases=10" --form "min_value=1" --form "max_value=10" --form "include_n_test_cases_flag=1" "https://test-case-generator.herokuapp.com/api"

With XML

curl -X POST -H "Content-Type: application/xml" -H "Accept: application/xml" -d '<xml><function_name>random_number</function_name><n_test_cases>10</n_test_cases><min_value>1</min_value><max_value>10</max_value><include_n_test_cases_flag>true</include_n_test_cases_flag></xml>' "https://test-case-generator.herokuapp.com/api"