# Ktor

### Setup

{% hint style="info" %}
In order to use the Ktor-extension it's required to have the [**skrapeit-core**](/docs/overview/setup.md#getting-super-powers) artifact in the classpath as well as having a proper Ktor setup up and running.
{% endhint %}

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```markup
<dependency>
   <groupId>it.skrape</groupId>
   <artifactId>skrapeit-core</artifactId>
   <version>LATEST</version>
   <scope>test</scope>
</dependency>
<dependency>
   <groupId>it.skrape</groupId>
   <artifactId>skrapeit-ktor</artifactId>
   <version>LATEST</version>
   <scope>test</scope>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle" %}
{% code title="build.gradle.kts" %}

```kotlin
testCompile("it.skrape:skrapeit-core:+")
testCompile("it.skrape:skrapeit-ktor:+")
```

{% endcode %}
{% endtab %}
{% endtabs %}

### How to Use

The [**skrape{it}**](/docs/master.md) **Ktor-extension** will extend Ktor's `TestApplicationResponse` with an`expectHtml{}` lambda function. The scope of the lambda will give you a parsed response body (deserialized to a `Doc`) and enables you to make comfortable assumptions about the content, properties and structure of the document.&#x20;

![Documentation by example](/files/-LdOgkgu4YuESAQFS6cG)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skrape.it/docs/extensions/ktor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
