Need help on servicestack implementation

强颜欢笑 提交于 2019-11-29 10:50:59

Just inspect the request DTO to see which fields are populated, i.e.

if (request.applicationId != null && request.countername != null) #2
if (request.userId != null && request.countername != null) #4
if (request.applicationId != null) #1
if (request.userid != null) #3

Also note that the user can populate the request dto with the querystring as well, i.e. if they called you with:

/perfmon/application/1/countername?userId=2

Then all fields will be populated. Lastly you can retrieve information about the Request with like the Absolute URI used to call the request with:

base.RequestContext.AbsoluteUri

Finally you can get the IHttpRequest object itself with:

var httpReq = base.Request; //or with base.RequestContext.Get<IHttpRequest>();
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!