Skip to content

Conversation

jandillmann
Copy link
Contributor

Currently, the generated cURL command for examples that include basic HTTP authentication contains the raw authentication header.

curl "http://api.example.org/" -d '' -X GET \
  -H "Authorization: Basic dXNlckBleGFtcGxlLm9yZzpwYXNzd29yZA=="

In my opinion, the command is more helpful the way a user would enter it into the terminal, e.g. using cURL's -u or --user option.

This pull request detects a HTTP basic auth header, decodes it, and generates a corresponding cURL command.

curl "http://api.example.org/" -d '' -X GET \
  -u [email protected]:password

@oestrich
Copy link
Contributor

This looks awesome. Thanks!

oestrich added a commit that referenced this pull request Jan 21, 2014
Decode HTTP basic auth header and generate cURL command with user and password
@oestrich oestrich merged commit 539ebe4 into zipmark:master Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants