Base solution for your next web application
Open Closed

How to get Http Request Header from AppServiceBase? #5513


User avatar
0
OriAssurant created

Our project is based on M5AJ1. We created a HttpPost method under a class that inherits AppServiceBase in Application project (so it is hosted on Owin). We could see and use the HttpPost method in swagger now.

The current issue is that I'm not able to retrieve the HttpHeader as there is no HttpContext or Request object in AppServiceBase, which is not implementing ApiController or IHttpController. I'm not able to inherit ApiController as I'm already inheriting AppServiceBase.

Just wondering how could I get request header information for this HttpPost method?

Thank you,


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Application layer methods should not rely on HttpContext or Request . If you want to get it, you can get it from the controller and pass it as a parameter to the application layer.