Is is possible to receive multiple gun_response messages for a single request? #352
-
|
Probably dumb question, but is possible to receive multiple Reason for asking is whether I need to implement code to merge multiple Header lists together when I collect the response, or if I can simply assume that this message will only arrive once per StreamRef. (*) For "standard Http verbs" GET/POST/DELETE etc, I'm not handling Server Push, Tunnels or WS at the moment. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You may get 0..N Typically informational response headers shouldn't be merged as they can be completely ignored. Trailer headers on the other hand are roughly the same as the response headers, only they arrive after the body. But since they arrive after the body, which may be very large, they are not normally merged. They are handled the same but separately (two sets of header fields). https://www.rfc-editor.org/rfc/rfc9110.html#name-processing-trailer-fields So I don't think you need to merge headers together except if you always need to add some headers to HTTP requests. I recommend reading https://www.rfc-editor.org/rfc/rfc9110.html if you need more info on how to process HTTP messages. |
Beta Was this translation helpful? Give feedback.
You may get 0..N
gun_informfollowed bygun_response, whereIsFinindicates whether the response is complete. After that the body may follow, and optionallygun_trailers.Typically informational response headers shouldn't be merged as they can be completely ignored.
Trailer headers on the other hand are roughly the same as the response headers, only they arrive after the body. But since they arrive after the body, which may be very large, they are not normally merged. They are handled the same but separately (two sets of header fields). https://www.rfc-editor.org/rfc/rfc9110.html#name-processing-trailer-fields
So I don't think you need to merge headers together except if you always need t…