diff --git a/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala b/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala index 0f96e64f..92ce58ee 100644 --- a/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala +++ b/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala @@ -7,6 +7,8 @@ import smithy4s.codecs.PayloadError import smithy4s.http._ import smithy4s.{ Blob, Endpoint, Hints, Schema } +import java.net.URLEncoder +import java.nio.charset.StandardCharsets import scala.concurrent.{ ExecutionContext, Future } private[smithy4play] class SmithyPlayClientEndpoint[Op[_, _, _, _, _], I, E, O, SI, SO]( @@ -97,7 +99,10 @@ private[smithy4play] class SmithyPlayClientEndpoint[Op[_, _, _, _, _], I, E, O, def buildPath(metadata: Metadata): String = baseUri + httpEndpoint.path(input).mkString("/") + metadata.queryFlattened - .map(s => s._1 + "=" + s._2) + .map(s => + URLEncoder.encode(s._1, StandardCharsets.UTF_8.name()) + "=" + URLEncoder + .encode(s._2, StandardCharsets.UTF_8.name()) + ) .mkString("?", "&", "") } diff --git a/smithy4playTest/test/TestControllerTest.scala b/smithy4playTest/test/TestControllerTest.scala index f03ea09c..e432814d 100644 --- a/smithy4playTest/test/TestControllerTest.scala +++ b/smithy4playTest/test/TestControllerTest.scala @@ -57,7 +57,7 @@ class TestControllerTest extends TestBase { "route to Test Endpoint by SmithyTestClient with Query Parameter, Path Parameter and Body" in { val pathParam = "thisIsAPathParam" - val testQuery = "thisIsATestQuery" + val testQuery = "this Is A Test Query" val testHeader = "thisIsATestHeader" val body = TestRequestBody("thisIsARequestBody") val result = genericClient.testWithOutput(pathParam, testQuery, testHeader, body).awaitRight