Return value in the Header of an HTTP (POST) call in the API [closed]

1

I'm using Postman to make the call in the API. That returns me this result in the body:

thatcomesfromthisabstractclass:

publicabstractclassResponseBase{publiclongSessionId{get;set;}}

Aftercollectingthevalueoftheproperty,itfallsintothismethodofclassBasicAuthHttpModule:

privatestaticvoidOnApplicationEndRequest(objectsender,EventArgse){varresponse=HttpContext.Current.Response;//response.AddHeader("SessionId", )
        if (response.StatusCode == 401)
        {
            response.Headers.Add("WWW-Authenticate",
                string.Format("Basic realm=\"{0}\"", Realm));
        }
    }

How do I pass the value of property SessionId to Header of the response?

In this class OnApplicationEndRequest I do not have access to SessionId , I do not know where it gets stored, to be passed in the return and to appear the value in PostMan.

    
asked by anonymous 26.04.2017 / 20:40

0 answers