shawhu
shawhu

Reputation: 1237

How to get ALL parameters send to a servicestack service?

I was just wondering how to use base.Request in a service.

for example, if the caller Post a form to the servicestack service, normally I can get each parameters by using

base.Request.GetParam("param_name")

but now there is a requirement that I will have to query and get ALL params.

How do I do that in servicestack using base.Request? Can I use items?

base.Request.Items

Upvotes: 1

Views: 103

Answers (1)

mythz
mythz

Reputation: 143319

The GetParam() API checks for the param in the HTTP Headers, QueryString, FormData or Cookies for the specified Param.

If you want to check all HTTP Params provided, you'll need to check them individually, e.g IRequest.QueryString.AllKeys, IRequest.FormData.AllKeys, etc.

IRequest.Items is an internal collection for your own use to attach per-request data, it doesn't contain HTTP Request data.

Upvotes: 2

Related Questions