Akka Http Client handling 'Connection: close' and 'Transfer-Encoding: chunked'

254 views
Skip to first unread message

cs...@cksworks.com

unread,
Apr 12, 2016, 2:22:10 PM4/12/16
to Akka User List
I'm using Akka Http Client 2.4.3 to invoke an API. I suspect the combination of 'Connection: close' and 'Transfer-Encoding: chunked' causing the databytes never materialized.

The raw response from the API as captured from curl is:

HTTP/1.1 200 OK

Date: Tue, 12 Apr 2016 18:13:13 GMT

Server: Apache

Set-Cookie: <Some Cookie>; Path=/; HttpOnly

Set-Cookie: <Some Cookie>; Expires=Fri, 10-Apr-2026 18:13:13 GMT; Path=/

Pragma: no-cache

Expires: Thu, 01 Jan 1970 00:00:00 GMT

Cache-Control: no-cache, no-store, must-revalidate, private

Vary: Accept-Encoding

Connection: close

Transfer-Encoding: chunked

Content-Type: application/json;charset=UTF-8


58

{"response":{"status":"success","value":"4o093l-0qhND.....7W35fsfnX8wjpnUjPWI3zx8BDc."}}

0



I did get the response. But, unmarshalling the entity never returns. My code to retrieve the the response entity is:


akkaHttp.singleRequest(req).flatMap { lithiumResponse =>
  logger.debug(s"Response: status = ${lithiumResponse.status}")
  Unmarshal(lithiumResponse.entity).to[JsValue] map { entity =>
logger.info(s"response entity (JSON) = $entity")
entity.extract[String]('response / 'value)
}

}


It never gets to the log statement.  Thanks for the help or pointer.


kc


André

unread,
Apr 13, 2016, 3:50:32 AM4/13/16
to Akka User List
Message has been deleted
Message has been deleted

cs...@cksworks.com

unread,
Apr 13, 2016, 7:13:35 PM4/13/16
to Akka User List
Nice. Thanks. Looks like 2.4.4 has that fixed and it's tagged. Waiting for that to show up on Maven Central.


Konrad Malawski

unread,
Apr 16, 2016, 3:45:39 AM4/16/16
to Akka User List

On Thu, Apr 14, 2016 at 1:13 AM, <cs...@cksworks.com> wrote:
Nice. Thanks. Looks like 2.4.4 has that fixed and it's tagged. Waiting for that to show up on Maven Central.


--
>>>>>>>>>> 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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,
Konrad 'ktoso' Malawski
Reply all
Reply to author
Forward
0 new messages