Question about ApiHeaderParameter


To test ApiHeaderParameter, invoked HttpApi service method like this

curl ... -H "x-my-secret-key: somethingsecret" http://localhost:8099/api/test

and to read x-my-secret-key header value at server, I tried following code but I couldnt’

[ApiMethod(HttpApiPath = "test", HttpApiMethod = ApiRequestMethod.Get)]
public string MyTestApi ([ApiHeaderParameter]string mySecretKey)
public string MyTestApi ([ApiHeaderParameter]string xMySecretKey)

How can server read x-my-secret-key header value?

1 Like


The name of the header should be X-mySecretKey (not case-sensitive) . I’ll log an issue to handle header names like X-my-Secret-Key (with dashes) as well.

You can drop a mail to support@ with your account name on and we’ll provide you a preliminary build with this update and (probably) update for the topic Getting a client ip address in HttpApi Service


1 Like

Logged as bugs://D19187.

Thank you!!!

bugs://D19187 was closed as fixed.