As described by @sergey-litvinov on #10:
- update
IHttpParserDelegate just to have common methods between request and response (Headers, Body, etc).
- create two interfaces
IHttpRequestParserDelegate and IHttpResponseParserDelegate that will inherit IHttpParserDelegate with Request\Response specific methods.
- two constructors for HttpParser.
- one receives
IHttpRequestParserDelegate.
- one receives
IHttpResponseParserDelegate.
- two member variables
- one
IHttpParserDelegate variable
- a flag as to whether the delegate is a
IHttpRequestParserDelegate or a IHttpResponseParserDelegate
- in the request/response-specific embedded actions, check the flag on and throw and exception if the value is unexpected