Hi James, the idea is quite simple: since Akka HTTP is so nicely stream-based, you get an HttpRequest that contains a Source instead of the actual data—those have at this point not yet been read from the TCP socket. As long as you don’t ask for the request body bytes you still have the chance to reply with an error code and thereby abort the request without consuming any data. But once you have made the decision to consume the data, you simply materialize the Source as part of some processing graph and the data will start flowing—by means of sending a 100-continue to the client.
I concur that the code itself does not easily reveal these semantics because this particular feature looks rather baroque when modeled as proper streams. HTTP is full of such idiosyncrasies :-) Regards, Roland > 9 apr 2015 kl. 20:02 skrev James Mulcahy <[email protected]>: > > I have a requirement to use 100-Continue [on the server side] in an akka-http > application I'm developing. As with most things akka-http, the documentation > is lacking in this area, but I'd hoped to be able to reverse engineer what I > needed from the commits referenced in the GitHub issue that implemented the > work. > > https://github.com/akka/akka/issues/15799 > > Unfortunately, despite having poured over this for some time, I'm still at a > bit of a loss. I was hoping the unit tests might shed some light, but > they're operating at a very low level, and use what appear to be some magic > constants to trigger certain behavior. > > A few questions, if someone in-the-know has time to enlighten me? > > - I'd expected to find a routing directive that I could use; but I don't see > any defined. Is this a reasonable expectation? > - > https://github.com/spray/akka/commit/dec95e5b1a1d1761a1d8fe65d8eec4dfacffa857#diff-a7b71e1d7cdab9f7bcd7c6ba9f2ae84dR503 > - Why does request(1) trigger the 100-Continue response? > - Is there any documentation or examples that might be more helpful than what > I've already found? > > Thanks in advance, > > --James > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/> > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html> > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > >>>>>>>>>> <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 [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/akka-user > <http://groups.google.com/group/akka-user>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. Dr. Roland Kuhn Akka Tech Lead Typesafe <http://typesafe.com/> – Reactive apps on the JVM. twitter: @rolandkuhn <http://twitter.com/#!/rolandkuhn> -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
