asp.net web api2 - How to obtain HttpRequestMessage outside of controller -


i have web api v2 controller makes method call out service in same project. service uses urlhelper class put url however, urlhelper class needs httprequestmessage in order build proper url.

how can obtain httprequestmessage within class (my service) outside of api controller? can pass httprequestmessage service method? there way access global context?

i using self-hosted environment (owin).

public class foocontroller : apicontroller {     public ihttpactionresult baraction()     {         urlhelper urlhelper = geturlhelperfromwhereever();         urlhelper.dosomething( this.request );     } 

this.request httprequestmessage: https://msdn.microsoft.com/en-us/library/system.web.http.apicontroller.request(v=vs.118).aspx#p:system.web.http.apicontroller.request


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -