# Question about ApiHeaderParameter

**URL:** https://talk.remobjects.com/t/question-about-apiheaderparameter/25750
**Category:** Remoting SDK
**Tags:** net, httpapi
**Created:** [November 26, 2021, 2:23am UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750 "2021-11-26T02:23:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gscmsnhcokr](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/g/a5b964/32.png) [@gscmsnhcokr](https://talk.remobjects.com/u/gscmsnhcokr)
#### Post date: [November 26, 2021, 2:23am UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750/1 "2021-11-26T02:23:48Z")

</div>

Hello.

To test ApiHeaderParameter, invoked HttpApi service method like this

```auto
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’

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

```

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

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [November 26, 2021, 3:17pm UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750/3 "2021-11-26T15:17:54Z")

</div>

Hello

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 [remobjects.com](http://remobjects.com) 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](https://talk.remobjects.com/t/getting-a-client-ip-address-in-httpapi-service/25749)

Regards

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [November 26, 2021, 3:46pm UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750/4 "2021-11-26T15:46:48Z")

</div>

Logged as [bugs://D19187](https://www.remobjects.com/portal/bugs/?id=D19187).

---

<div class="post-metadata">

### Author: ![gscmsnhcokr](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/g/a5b964/32.png) [@gscmsnhcokr](https://talk.remobjects.com/u/gscmsnhcokr)
#### Post date: [November 29, 2021, 1:34am UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750/5 "2021-11-29T01:34:41Z")

</div>

Thank you!!!

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [November 29, 2021, 12:25pm UTC](https://talk.remobjects.com/t/question-about-apiheaderparameter/25750/6 "2021-11-29T12:25:54Z")

</div>

[bugs://D19187](https://www.remobjects.com/portal/bugs/?id=D19187) was closed as fixed.
