C# Class GuaranteedRate.Net.RequestStitching.MessageHandlers.RequestStitchingMessageHandler

Inheritance: System.Net.Http.DelegatingHandler
ファイルを表示 Open project: Guaranteed-Rate/Net.RequestStiching

Public Methods

Method Description
RequestStitchingMessageHandler ( bool generateIfMissing ) : System

Extracts X-Session-Id and X-Request-Id from request header and stores them in the current HTTP context. Adds X-Session-Id and X-Request-Id to the response header.

Use RequestContext.RequestId and RequestContext.SessionId to retrieve the values.

Protected Methods

Method Description
SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task

Private Methods

Method Description
SetResponseHeader ( HttpResponseMessage response, RequestHeader requestHeader, string value ) : void
StitchRequestHeader ( HttpRequestMessage request, RequestHeader requestHeader ) : string

Method Details

RequestStitchingMessageHandler() public method

Extracts X-Session-Id and X-Request-Id from request header and stores them in the current HTTP context. Adds X-Session-Id and X-Request-Id to the response header.
Use RequestContext.RequestId and RequestContext.SessionId to retrieve the values.
public RequestStitchingMessageHandler ( bool generateIfMissing ) : System
generateIfMissing bool Sends a Bad Request response if X-Request-Id and X-Session-Id are not include in the request header
return System

SendAsync() protected method

protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
return Task