Hi Srinaath,

does it work with 

  "https://example.com/customers/~/profiles/dj2bQryHPCj4IVrc48xTPD 
hswk%2FqNWx LuUA0G2T6GLnyBVD6wC231IjgDBYJnt/preferences"

?

Akka should replace the spaces with a "+" while a "+" as input will get 
encoded as "%2B".

HTH
André

Srinaath

On Friday, September 16, 2016 at 5:56:16 PM UTC+2, Srinaath Thyagarajan 
wrote:
>
> 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/ 
> <https://www.google.com/url?q=https%3A%2F%2Fexample.com%2Fcustomers%2F~%2Fprofiles%2F&sa=D&sntz=1&usg=AFQjCNG6z6l7ghxZsB3W5uY6uM63_u_ATQ>*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? 
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to