小编Sau*_*abh的帖子

为什么 wget 第一次不在 URL 中使用用户名和密码

下面是wget的命令和响应,它第一次不使用提供的用户名和密码得到401,后来它使用auth得到200。

这对 curl 很有效,但同样的事情也会通过 Postman 发生,这是什么现象以及为什么会发生?

$> wget 'http://userName:password@host:port/v1/api'
--2018-08-31 16:06:01--  http://userName:password@host:port
Connecting to host:port... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: Basic realm="myApp", API-Key realm="myApp"
Reusing existing connection to host:port.
HTTP request sent, awaiting response... 200 OK
Length: 146 [application/json]
Saving to: 'api'

api 100%[==================================================================================================================>]     146  --.-KB/s   in 0s

2018-08-31 16:06:01 (9.28 MB/s) - 'api' saved [146/146]
Run Code Online (Sandbox Code Playgroud)

authentication wget curl

6
推荐指数
1
解决办法
6545
查看次数

标签 统计

authentication ×1

curl ×1

wget ×1