Basic authentication with service stack Basic authentication with service stack apache apache

Basic authentication with service stack


Seems like you're having the same problem as this poster: ServiceStack Web Service with Basic Authentication and SetCredentials He managed to get authentication working with the following code:

class Program{    const string BaseUrl = "http://localhost:8088/api";    static void Main(string[] args)    {        var restClient = new JsonServiceClient(BaseUrl);        restClient.SetCredentials("john", "test");        restClient.AlwaysSendBasicAuthHeader = true;        HelloResponse response = restClient.Get<HelloResponse>("/hello/Leniel");        Console.WriteLine(response.Result);    }}//Response DTO//Follows naming conventionpublic class HelloResponse{    public string Result { get; set; }}

I recommend reading the entire question and answer, as it includes detailed explanations.