I created a HttpRequestMessage with header using **windows.web.http;** library:

```
var request = base.CreateHttpRequestMessage();
        request.Headers.Add("SESSION", SessionId);
        return request;

```

and after sending SendRequestAsync(); , I am able to get the response successfully .

But in my case I need to use **system.net.http;** library, with same codes:

```
var request = base.CreateHttpRequestMessage();
        request.Headers.Add("SESSION", SessionId);
        return request;

```

but when I am calling the SendAsync(); , I am getting an UnAuthorized response.
Does anyone knows what causing the issue?

```
var source = new CancellationTokenSource(timeout)
var response = await _client.SendAsync(request, source.Token)
                    .ConfigureAwait(false);

```

**NOTE:** I tried manually setting same valid **SessionId** for both , on **windows.web.http** its Okay, but on **system.net.http** its unauthorized.

How I initialize my HttpClient:

```
private HttpClientHandler handler;
handler = new HttpClientHandler();

private HttpClient _client;
_client = new HttpClient(handler)

```

**Reference Link:** <https://learn.microsoft.com/en-us/dotnet/api/system.net.http?view=netframework-4.7.2>   

<https://learn.microsoft.com/en-us/uwp/api/windows.web.http>

**Requests Header format:**  

windows.web.http:
[![enter image description here](https://i.stack.imgur.com/O2fKc.jpg)](https://i.stack.imgur.com/O2fKc.jpg)
system.net.http:
[![enter image description here](https://i.stack.imgur.com/2F0Mv.jpg)](https://i.stack.imgur.com/2F0Mv.jpg)

Thanks.