nakabonne/ali

Add support for basic auth?

erikbos opened this issue · 4 comments

Fun tool! It would be great if http basic auth would be supported via cli as well

@erikbos Hi, thank you for your interest! You can use the -H option to set HTTP headers.

$ echo -n 'user:pass' | base64
dXNlcjpwYXNz
$ ali -H "Authorization:Basic dXNlcjpwYXNz" http://host.xz

Indeed that works.. just saying that something like -u user:passwd would be nice to have. Yes, I am lazy :-)

@erikbos you can also use this way (which also works on browsers!):

ali http://myuser:mypassword@host.xz

@nakabonne perhaps adding this to README is a good idea?

@brenol Thanks. Yeah, I'll add a couple of examples for various kinds of use cases in the near future.