Microsoft.Web.Administration.JexusServerManager.LocalhostTestAsync C# (CSharp) Method

LocalhostTestAsync() public method

public LocalhostTestAsync ( string path, string random ) : Task
path string
random string
return Task
        public async Task<bool> LocalhostTestAsync(string path, string random)
        {
            using (var client = GetClient())
            {
                HttpResponseMessage response = await client.PostAsJsonAsync("api/server/test", path);
                if (response.IsSuccessStatusCode)
                {
                    var value = (string)await response.Content.ReadAsAsync(typeof(string));
                    return value == random;
                }

                return false;
            }
        }