Hello, I am trying to make REST API call with akka http client. Below is 
"log in" request:

Http().singleRequest(HttpRequest(...)).flatMap { resp =>
 println("headers = " + resp.headers)
 println("cookie = " + resp.header[`Set-Cookie`])

This is what I see in console:

headers = List(set-cookie: myCookie=blahblah; Expires=Fri, 24 Jan 2020 13:42
:55 GMT; Domain=; Path=/, Server: akka-http/10.1.6, Date: Thu, 24 Jan 2019 
13:42:55 GMT)
cookie = None

In debugger I see that 'headers' collection contains RawHeader with 
In network sniffer I see:

Set-Cookie: myCookie=blahblah; Expires=Fri, 24 Jan 2020 13:42:55 GMT; Domain
=; Path=/

Also there is a warning from akka:

Illegal header: Illegal 'set-cookie' header: Invalid input ';', expected 
OWS or domain-value (line 1, column 145): myToken=blahblah; Expires=Fri, 24 
Jan 2020 13:42:55 GMT; Domain=; Path=/

The cookie is set at server-side by 'setCookie' routing directive (under 
the same version of Java, Scala, Akka etc, at the same Linux machine, 
localhost), browsers understand it. I use Scala 2.12.8, akka 2.5.19, akka 
http 10.1.6, Java 8

What is wrong here?

P.S. Sorry fro cross-sending it here - I sent this problem to discussion 
forum a few days ago but seems there is no activity

** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
>>>>>>>>>>      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