簡體   English   中英

如何在ServiceStack中獲取請求的時間戳?

[英]How can I get a request's timestamp in ServiceStack?

這似乎很愚蠢,但我在ServiceStack中找不到請求時間戳。 我正在尋找與之等效的ServiceStack

this.Request.RequestContext.HttpContext.Timestamp 

在ASP.NET MVC中。

我看了看請求標頭,但那里沒有類似的東西。

在ASP.NET主機中,您可以將其從HttpContext單例中刪除,即:

HttpContext.Current.Timestamp

否則,如果您不想使用單例,則可以沿Request對象圖向下移動,即:

var aspnetRequest = (HttpRequest)base.Request.OriginalRequest;
aspnetRequest.RequestContext.HttpContext.Timestamp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM