mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-09 04:56:29 +00:00
Added syntax highlighting to docs/getting-started.md (#1619)
This commit is contained in:
committed by
Ryan Gribble
parent
d0ea6aea80
commit
8877eea1cb
@@ -2,7 +2,7 @@
|
||||
|
||||
The easiest way to get started with Octokit is to use a plain `GitHubClient`:
|
||||
|
||||
```
|
||||
```csharp
|
||||
var client = new GitHubClient(new ProductHeaderValue("my-cool-app"));
|
||||
```
|
||||
|
||||
@@ -18,12 +18,12 @@ If you want to access private repositories or perform actions on behalf of a use
|
||||
|
||||
There are two options supported by the API - basic and OAuth authentication.
|
||||
|
||||
```
|
||||
```csharp
|
||||
var basicAuth = new Credentials("username", "password"); // NOTE: not real credentials
|
||||
client.Credentials = basicAuth;
|
||||
```
|
||||
|
||||
```
|
||||
```csharp
|
||||
var tokenAuth = new Credentials("token"); // NOTE: not real token
|
||||
client.Credentials = tokenAuth;
|
||||
```
|
||||
@@ -66,7 +66,7 @@ Console.WriteLine("{0} has {1} public repositories - go check out their profile
|
||||
|
||||
If you've authenticated as a given user, you can query their details directly:
|
||||
|
||||
```
|
||||
```csharp
|
||||
var user = await client.User.Current();
|
||||
```
|
||||
|
||||
@@ -92,4 +92,4 @@ var whenDoesTheLimitReset = rateLimit?.Reset;
|
||||
|
||||
An authenticated client will have a significantly higher limit than an anonymous client.
|
||||
|
||||
For more information on the API and understanding rate limits, you may want to consult [the Github API docs on rate limits](https://developer.github.com/v3/#rate-limiting).
|
||||
For more information on the API and understanding rate limits, you may want to consult [the Github API docs on rate limits](https://developer.github.com/v3/#rate-limiting).
|
||||
|
||||
Reference in New Issue
Block a user