https://kotlinlang.org logo
#ktor
Title
# ktor
m

Matthieu Stombellini

09/02/2021, 12:31 PM
Hi, how can I use
Parameters.build
now that
StringValuesBuilder
is internal? My use case is sending a request that has
application/x-www-form-urlencoded
data. Using this:
Copy code
FormDataContent(Parameters.build {
    append("some", "thing")
})
results in a warning (and an error in my case since I'm using
-Werror
) on the
append
call.
This API is internal in ktor and should not be used. It could be removed or changed without notice.
This is because
StringValuesBuilder
is marked with
@InternalAPI
, andd using it is required for doing basically any building for parameters. Is it now impossible to use
FormDataContent
without relying on Ktor's internals?
l

Lars Toft Jacobsen

09/02/2021, 1:09 PM
Not quite sure why you need the
FormDataContent
- but anyway it looks like you can use
Parameters
factories now i.e.
parametersOf()
a

Aleksei Tirman [JB]

09/02/2021, 2:39 PM
@Matthieu Stombellini just add
@OptIn(InternalAPI::class)
for now. For more information please read https://youtrack.jetbrains.com/issue/KTOR-3001#focus=Comments-27-5105259.0-0.
42 Views