<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Concepts on genhttp-kt</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/</link><description>Recent content in Concepts on genhttp-kt</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://genhttp-kt.genhttp.run/documentation/content/concepts/index.xml" rel="self" type="application/rss+xml"/><item><title>Request API</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/request-api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/request-api/</guid><description>&lt;h2 id="request-api"&gt;Request API&lt;a class="anchor" href="#request-api" aria-label="Link to this section"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To handle incoming HTTP requests, genhttp-kt uses the &lt;code&gt;Request&lt;/code&gt; abstraction, which - besides granting access to&#10;infrastructure components such as the &lt;code&gt;Server&lt;/code&gt;, &lt;code&gt;EndPoint&lt;/code&gt; or &lt;code&gt;ClientConnection&lt;/code&gt; - is intended to represent the data&#10;on the wire as it was received by the connected client.&lt;/p&gt;&#10;&lt;p&gt;The core entry points to handle requests are &lt;a href="../../handlers/"&gt;handlers&lt;/a&gt; and &lt;a href="../../concerns/"&gt;concerns&lt;/a&gt;. The server&#10;host is passed a handler instance (known as root handler) which is then responsible for handling all incoming requests.&#10;If needed, it can use other handlers to delegate work (see &lt;a href="../../handlers/layouting/"&gt;layouting&lt;/a&gt; as a starting point).&lt;/p&gt;</description></item><item><title>Routing</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/routing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/routing/</guid><description>&lt;p&gt;When the server receives a request from the client, it passes it to the root handler&#10;specified by your application. Depending on the requested path, this handler&#10;may invoke additional handlers to actually produce a response. The tree of handlers&#10;available in your application is called &lt;em&gt;handler chain&lt;/em&gt;. As requests are passed&#10;from one handler to another, they need to track, which segments of the requested&#10;path have already been considered and which still need to be evaluated,&#10;effectively decoupling them from each other. This&#10;capability is provided by the routing feature of the framework.&lt;/p&gt;</description></item><item><title>Method Definitions</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/definitions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/definitions/</guid><description>&lt;p&gt;All API frameworks share a common base provided by the &lt;code&gt;Reflection&lt;/code&gt; and &lt;code&gt;Conversion&lt;/code&gt; modules which&#10;define some of the capabilities that can be used when defining an API method&#10;signature.&lt;/p&gt;&#10;&lt;h2 id="injection"&gt;Injection&lt;a class="anchor" href="#injection" aria-label="Link to this section"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This section describes how parameters of your functions are initialized and which&#10;kind of types can be used.&lt;/p&gt;&#10;&lt;h3 id="primitives"&gt;Primitives&lt;a class="anchor" href="#primitives" aria-label="Link to this section"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;By default, a parameter type can be used within a method definition if it is either &lt;code&gt;String&lt;/code&gt;,&#10;&lt;code&gt;Boolean&lt;/code&gt;, an enum, a number (such as &lt;code&gt;Int&lt;/code&gt;, &lt;code&gt;Long&lt;/code&gt;, &lt;code&gt;Double&lt;/code&gt; or &lt;code&gt;BigDecimal&lt;/code&gt;), a &lt;code&gt;UUID&lt;/code&gt;, or one of&#10;the date and time types &lt;code&gt;Instant&lt;/code&gt;, &lt;code&gt;OffsetDateTime&lt;/code&gt;, &lt;code&gt;LocalDateTime&lt;/code&gt;, &lt;code&gt;LocalDate&lt;/code&gt;, &lt;code&gt;LocalTime&lt;/code&gt; and&#10;&lt;code&gt;kotlin.time.Duration&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Execution Modes</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/execution-modes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/execution-modes/</guid><description>&lt;p&gt;The service frameworks (&lt;a href="../../frameworks/webservices/"&gt;webservices&lt;/a&gt;, &lt;a href="../../frameworks/functional/"&gt;functional handlers&lt;/a&gt;&#10;and &lt;a href="../../frameworks/controllers/"&gt;controllers&lt;/a&gt;) analyze the signature of each of your functions with&#10;&lt;a href="https://kotlinlang.org/docs/reflection.html" rel="noopener"&gt;kotlin-reflect&lt;/a&gt;: where every argument is read from, how the result&#10;is sent to the client and which &lt;a href="../definitions/#interceptors"&gt;interceptors&lt;/a&gt; run before the function. This analysis&#10;is done once, while the handler chain is prepared (i.e. when the server starts), and not when a request is handled.&lt;/p&gt;&#10;&lt;p&gt;For every request, the framework then reads the arguments in the order of the parameters, invokes the function and&#10;maps the result into an HTTP response. How the function is invoked is controlled by the execution mode.&lt;/p&gt;</description></item><item><title>Response Content</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/response-content/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/response-content/</guid><description>&lt;div class="cards"&gt;&#10;&lt;a class="card card-icon" href="https://central.sonatype.com/artifact/org.genhttp/genhttp-modules-io" rel="noopener"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="m16.5 9.4-9-5.19"/&gt;&lt;path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/&gt;&lt;path d="M3.29 7 12 12l8.71-5M12 22V12"/&gt;&lt;/svg&gt;&lt;span class="card-title"&gt;genhttp-modules-io&lt;/span&gt; &lt;span class="card-text"&gt;Package on Maven Central&lt;/span&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M7 17 17 7M8 7h9v9"/&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;When sending content in response to a client request, &lt;code&gt;ResponseBuilder&lt;/code&gt; has a single entry point for it:&#10;&lt;code&gt;content(content: ResponseContent?)&lt;/code&gt;. Everything about the content itself - its &lt;code&gt;length&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt; and&#10;&lt;code&gt;encoding&lt;/code&gt; - is a property of the &lt;code&gt;ResponseContent&lt;/code&gt; implementation being passed in, not something configured&#10;separately on the builder. &lt;code&gt;length&lt;/code&gt; is the number of bytes the content will produce; if it is not known,&#10;chunked transfer encoding is applied.&lt;/p&gt;</description></item><item><title>Resources</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/resources/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/resources/</guid><description>&lt;div class="cards"&gt;&#10;&lt;a class="card card-icon" href="https://central.sonatype.com/artifact/org.genhttp/genhttp-modules-io" rel="noopener"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="m16.5 9.4-9-5.19"/&gt;&lt;path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/&gt;&lt;path d="M3.29 7 12 12l8.71-5M12 22V12"/&gt;&lt;/svg&gt;&lt;span class="card-title"&gt;genhttp-modules-io&lt;/span&gt; &lt;span class="card-text"&gt;Package on Maven Central&lt;/span&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M7 17 17 7M8 7h9v9"/&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;genhttp-kt provides a thin abstraction layer to control access of binary resources&#10;(such as files or blobs). This allows to re-use file-dependent handlers, independent from&#10;whether the data comes from the file system, the classpath, a database or somewhere else.&lt;/p&gt;</description></item><item><title>Dependency Injection</title><link>https://genhttp-kt.genhttp.run/documentation/content/concepts/dependency-injection/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://genhttp-kt.genhttp.run/documentation/content/concepts/dependency-injection/</guid><description>&lt;div class="cards"&gt;&#10;&lt;a class="card card-icon" href="https://central.sonatype.com/artifact/org.genhttp/genhttp-modules-dependency-injection" rel="noopener"&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="m16.5 9.4-9-5.19"/&gt;&lt;path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/&gt;&lt;path d="M3.29 7 12 12l8.71-5M12 22V12"/&gt;&lt;/svg&gt;&lt;span class="card-title"&gt;genhttp-modules-dependency-injection&lt;/span&gt; &lt;span class="card-text"&gt;Package on Maven Central&lt;/span&gt;&lt;svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"&gt;&lt;path d="M7 17 17 7M8 7h9v9"/&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;This optional module allows to use &lt;a href="https://insert-koin.io/" rel="noopener"&gt;Koin&lt;/a&gt; to inject dependencies into handlers,&#10;concerns and framework classes as well as their functions.&lt;/p&gt;</description></item></channel></rss>