Sync gateway version: 2.0.0-823
Couchbase Server version: 5.5.0-2036
Couchbase Lite version: v2.0.0-db023
.NET
I try to get the sync gateway database setting by sending a GET request to let’s say http://xxxxxxx:4984/item. It goes perfectly well with Postman, I get a nice 200OK
When I tretry in .NET I get a 401Unauthorized
my code is
using (HttpClient _client = new HttpClient()) {
HttpResponseMessage response = await _client.GetAsync(dbInfoUrl);
if (response.IsSuccessStatusCode)
{
...
even if I try with basic auth
in this form:
_client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes($"xxx:xxx")));
I get the same error… .
What am I doing wrong here?