Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Templetize cURL examples that use usernames and tokens for authentication#346

Merged
izuzak merged 1 commit into
masterfrom
curl-examples
Nov 1, 2013
Merged

Templetize cURL examples that use usernames and tokens for authentication#346
izuzak merged 1 commit into
masterfrom
curl-examples

Conversation

@izuzak

@izuzak izuzak commented Nov 1, 2013

Copy link
Copy Markdown
Member

As mentioned in #330, the curl examples in the Authentication docs might be misleading for some users.

For example, users shouldn't try to authenticate as mojombo because it will fail, and some users might think that the way to fix this is to modify the URL somehow (e.g. replace user with their username):

$ curl -u mojombo https://api.github.com/user

Instead, I'd like to suggest a templetized approach to the curl command, like so:

$ curl -u <username> https://api.github.com/user

Using :username as the format for templetizing might be confusing when not used in the URL. The second curl example in this page demonstrates this problem. So, this could be confusing:

$ curl -u :token:x-oauth-basic https://api.github.com/user

but this probably won't be:

$ curl -u <token>:x-oauth-basic https://api.github.com/user

cc @gjtorikian @jasonrudolph

@pengwynn

pengwynn commented Nov 1, 2013

Copy link
Copy Markdown
Contributor

As a rule of 👍 when I'm consuming these examples, I generally prefer:

  • <value> for direct CLI user input
  • :value for path segments
  • {value} for query param expansion, URI template style.

I dig this change.

@jasonrudolph

Copy link
Copy Markdown
Contributor

👍

@izuzak

izuzak commented Nov 1, 2013

Copy link
Copy Markdown
Member Author

@pengwynn Ah, that makes a sense and feels natural. 👍 I'll see if there are any other curl requests we can clean up.

izuzak added a commit that referenced this pull request Nov 1, 2013
Templetize cURL examples that use usernames and tokens for authentication
@izuzak izuzak merged commit 192a0a2 into master Nov 1, 2013
@izuzak izuzak deleted the curl-examples branch November 1, 2013 16:04
jakeboxer pushed a commit that referenced this pull request Nov 24, 2014
…ange

Add blog post for delaying "add team member" API change again
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants