Finised text part of documentation
This commit is contained in:
@@ -3,30 +3,61 @@
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col h-full gap-4">
|
||||
<div class="flex flex-row">
|
||||
<a href="/rest/mock" class="tool-button">Back to REST Mock</a>
|
||||
</div>
|
||||
<div class="dark:text-slate-100">
|
||||
<div class="dark:text-slate-100 w-full h-full text-justify overflow-auto px-2">
|
||||
<h2 class="text-2xl font-bold mt-4 mb-2">Description</h2>
|
||||
<p><span class="font-medium">REST Mock</span> is a tool allowing to create temporary REST endpoint that allows to test REST clients.</p>
|
||||
<p><span class="font-medium">REST Mock</span> is a tool allowing to create temporary REST endpoint called REST Mock, that allows to test REST clients.</p>
|
||||
<br>
|
||||
<p>It's main functions are:</p>
|
||||
<p>Its main functions are:</p>
|
||||
<ul class="list-disc ml-5">
|
||||
<li>Generating random URL for each user, one per user, with persistence for 24h. {check}</li>
|
||||
<li>Customizable HTTP response status code</li>
|
||||
<li>Customizable response body and it's content type</li>
|
||||
<li>Customizable response body and its content type</li>
|
||||
<li>Customizable response headers</li>
|
||||
<li>History of connections to generated endpoint with ability to look into request method, headers and body</li>
|
||||
</ul>
|
||||
<!-- <h2 class="text-2xl font-bold mt-4 mb-2">Technical Nuances</h2> -->
|
||||
<h2 class="text-2xl font-bold mt-4 mb-2">GUI elements</h2>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">URL field</h3>
|
||||
<p>This field contains autogenerated URL for your REST Mock. All links are removed every 24h.{check}</p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">"Save" button</h3>
|
||||
<p>Applies every change made on this page and saves it between sessions. </p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">Response Content Type field</h3>
|
||||
<p>Its just convenient way to set "Content-Type" header in the response.</p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">Response HTTP Status field</h3>
|
||||
<p>This field sets HTTP status that will be sent to client. Any valid HTTP status can be used, by default it's 200 OK.</p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">Response Body field</h3>
|
||||
<p>Here you can set response body. This is sophisticated text editor with syntax-highlighting based on detected language. It works both with JSON and XML data.</p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">Response Headers section</h3>
|
||||
<p>This section contains three default and unremovable headers ("Connection", "Date", "Keep-Alive") as well as empty field used to adding custom header. Adding header with empty value is possible, but every header has to have a name. When adding new header is possible, the "Add" button becomes active.</p>
|
||||
|
||||
<h3 class="text-lg font-medium mt-2">History</h3>
|
||||
<p>This section allows to look into history of requests sent to current REST Mock. If request has body, "Show body" button appears in its entry. Also there is option to look into every request's headers by clicking "Show Headers" button.</p>
|
||||
|
||||
<h2 class="text-2xl font-bold mt-4 mb-2">Example</h2>
|
||||
<p>Let's say we want to create temporary endpoint that returns code 200 with body:</p>
|
||||
<div class="p-2 bg-slate-800 rounded-md"><pre>{
|
||||
<div class="p-2 my-2 dark:bg-slate-800 bg-slate-200 rounded-md"><pre>{
|
||||
"status": "completed",
|
||||
"warnings": "none"
|
||||
}</pre></div>
|
||||
|
||||
<p>Additionally we want to set some headers:</p>
|
||||
<div class="p-2 my-2 dark:bg-slate-800 bg-slate-200 rounded-md"><pre> Name Value
|
||||
operation addition
|
||||
priority urgent
|
||||
</pre></div>
|
||||
<p>In this example we will focus on the left-hand side panel first as it contains most of the settings. On the top you see autogenerated URL link to your REST Mock service and the "Save" button that saves every setting on this page.</p><br/>
|
||||
<p>Next, down from REST Mock URL are two text fields. One for content type of a response and second for the HTTP status of a response. </p><br/>
|
||||
<p>These two fields are first things that we will set in this example. Out content type is JSON, so we will put "application/json" in "Response Content Type" field. The "Response HTTP Status" field we'll leave unchanged for now.</p><br/>
|
||||
<p>Next element of this tool is big "Response Body" text field. Here you can put data that you want your REST Mock to respond with. In this example we will put JSON from few lines above.</p>
|
||||
<p>Last thing that we have to set are headers. Those we can set in Headers section.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user