c# - .NET 4.6 HttpResponse.PushPromise methods to manage http/2 PUSH_PROMISE header -


i bit confused push promise http/2 header handling in .net4.6.

when look httpresponse.pushpromise there 2 overloads:

one accepts path resource public void pushpromise(string path) - assuming resource read , binary sent across client.

second public void pushpromise(string path, string method, namevaluecollection headers) accepts sting method , namevaluecollection headers failing understand.

why want pass method (assuming httpmethod get, post, etc) , collection of headers inside push promise header?

from reading http/2 spec (section 8.2), here gather:

passing method

push_promise frames required cacheable , safe. have option of using get , head, 2 http methods defined both safe , cacheable.

passing headers

since push_promise frames required cacheable, used add specific cache-control directives promise. section 8.2.2 of spec states client has option download promised stream , can refuse it, imagine client if found had up-to-date version of resource in cache.

controlling caching obvious reason can see why might pass headers, there may other reasons well. if you're writing custom client, may use x-headers provide other hints (that aren't related caching) client can decide whether or not wants accept promised stream.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -