curl的基本授权命令 [英] basic authorization command for curl
本文介绍了curl的基本授权命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用64个编码凭证设定基本授权?
我试过下面的两个命令,但没有使用,请建议。
How do I set up the basic authorization using 64 encoded credentials ? I tried below the two commands but of no use , please suggest.
curl -i -H 'Accept:application/json' Authorization:Basic <username:password> http://example.com
curl -i -H 'Accept:application/json' Authorization:Basic.base64_encode(username:password) http://example.com
推荐答案
使用 -H
授权:基本的东西。因此它将是
Use the -H
header again before the Authorization:Basic things. So it will be
curl -i \
-H 'Accept:application/json' \
-H 'Authorization:Basic username:password' \
http://example.com
这篇关于curl的基本授权命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文