I am trying to invoke a Rest API using akka http client using below code.
val httpRequest = HttpRequest(
method = HttpMethods.GET,
uri ="https://example.com/customers/~/profiles/dj2bQryHPCj4IVrc48xTPD%2Bhswk%2FqNWx%2BLuUA0G2T6GLnyBVD6wC231IjgDBYJnt/preferences",
headers = List(Accept(MediaRange(MediaTypes.`application/json`.withParams(Map("v" → "3")))),
RawHeader("Content-Type", "application/json;v=3"),
RawHeader("Api-Key", "XYZ")
)
)
Http().singleRequest(httpRequest, GatewayHelper.connectionContext)
Before the call goes out, when i check the httprequest.uri (through debugger), there is a partial uri decoding that is happening (%2B changed to +) "https://example.com/customers/~/profiles/dj2bQryHPCj4IVrc48xTPD+hswk%2FqNWx+LuUA0G2T6GLnyBVD6wC231IjgDBYJnt/preferences"
Because of this the API is returning an error. Unfortunately, there are bunch or APIs that has this type of path variable . So not able to invoke using akka-http .
I also tried setting the parsing mode to Relaxed hoping that it would not tamper the path variable, but it didnt help either.
Uri.apply("https://example.com/customers/~/profiles/dj2bQryHPCj4IVrc48xTPD%2Bhswk%2FqNWx%2BLuUA0G2T6GLnyBVD6wC231IjgDBYJnt/preferences", Uri.ParsingMode.Relaxed)
So, Is there option where we can make akka no modify this before making the httprequest?