I have created an app password as explained here
But now, how do I access the repository using this app password?
What will be the url?
Can someone direct me to a page showing an example please?
The below is a code for github. How do I do it for bitbucket?
var githubToken = "[token]";
var url = "https://github.com/[username]/[repository]/archive/[sha1|tag].zip";
var path = @"[local path]";
using (var client = new System.Net.Http.HttpClient())
{
var credentials = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}:", githubToken);
credentials = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(credentials));
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", credentials);
var contents = client.GetByteArrayAsync(url).Result;
System.IO.File.WriteAllBytes(path, contents);
}
Update
Go to Personal Settings and then App Passwords as shown below.
githubToken
andhttps://github.com/
. Which system are you actually trying to use? – Tessellation