简体   繁体   中英

Servicestack request add param to every query

I want to modify the RequestURI in the request from a Servicestack 'JsonServiceClient', however, the request URI is readonly. The Restful API that i'm trying to use requires a 'apikey' be sent in the URI of the GET request, instead of in the headers like i would expect. I know i could create a base class such as 'CommonRequest' and put the 'apikey' in there, but that sounds wrong, and instead I should be modifying the request pre-execution.

I have tried using the request filters built into ServiceStack, but that doesn't let me modify the Request.

Any ideas?

Peter

您无法修改请求,但可以通过将其添加到IRequest.Items字典来附加其他元数据。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM