CS-Coursework/documentation/html/get_test.html

58 lines
3.8 KiB
HTML

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
<div class="markdown-heading"><h1 class="heading-element">Test API Endpoint</h1><a id="user-content-test-api-endpoint" class="anchor" aria-label="Permalink: Test API Endpoint" href="#test-api-endpoint"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="markdown-heading"><h2 class="heading-element">GET <code>/api/test</code>
</h2><a id="user-content-get-apitest" class="anchor" aria-label="Permalink: GET /api/test" href="#get-apitest"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<p>Returns 100 random words to be used to give a typing test. Retrieved from <code>wordlist.txt</code></p>
<div class="markdown-heading"><h2 class="heading-element">Responses</h2><a id="user-content-responses" class="anchor" aria-label="Permalink: Responses" href="#responses"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<ul>
<li>
<code>200 OK</code>: Successfully retrieves the 100 words.</li>
<li>
<code>404 Not Found</code>: Indicates that the wordlist was not found.</li>
</ul>
<div class="markdown-heading"><h2 class="heading-element">Example Request</h2><a id="user-content-example-request" class="anchor" aria-label="Permalink: Example Request" href="#example-request"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="highlight highlight-source-shell"><pre>curl -X GET <span class="pl-s"><span class="pl-pds">"</span>https://url/api/test<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading"><h2 class="heading-element">Example Response</h2><a id="user-content-example-response" class="anchor" aria-label="Permalink: Example Response" href="#example-response"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="highlight highlight-source-json"><pre>[
<span class="pl-s"><span class="pl-pds">"</span>separate<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>stand<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>think<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>island<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>have<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>air<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>heard<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>notice<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>yellow<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>smell<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>heart<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>island<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>chief<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>view<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>top<span class="pl-pds">"</span></span>,
<span class="pl-ii">...</span>
]</pre></div>
</body>
</html>