How to asynchronously get headers without downloading the entire page?

58 views Asked by At

I want to implement logic to download parts (the first few megabytes) of http pages if the response content type is "text/html" (and check it without downloading the entire page) or skip otherwise. This is possible using Apache http client, but it is synchronous. Is exists asynchronous http client that allows me to do this filtering without downloading the whole page in scala? May be this is real to make with spray-client or something similar?

1

There are 1 answers

1
Sky On

Take a look at: https://jazzy.id.au/2013/07/16/100_continue_support_in_play.html

Play support 100-continue status code.

Spray-client does not support yet: https://github.com/spray/spray/issues/894 and https://github.com/akka/akka/issues/15799