do you know what fetchDSL is
- User
do you know what fetchDSL is
Assistant
FetchDSL is a Domain Specific Language (DSL) in Kotlin for making HTTP requests. It allows you to build request URLs, set headers, parse JSON responses, upload files, and much more - all using a nice Kotlin DSL.
Some examples of using FetchDSL:
Make a GET request:
val response = fetch("https://example.com") { }Set headers:
fetch("https://example.com") { header("Authorization", "token abc123") }Post form data:
fetch("https://example.com/posts") { method = HttpMethod.Post header("Content-Type", "application/x-www-form-urlencoded") body = "title=Hello&content=World" }Upload files:
fetch("https://example.com/posts") { method = HttpMethod.Post header("Content-Type", "multipart/form-data") bodyPart("title", "Hello") bodyPart("file", File("file.txt")) }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.