Below is the command and response of wget, It first time does not use provided userName and password and get 401, later it uses the auth and gets 200.
This works well with curl but same thing happens via Postman as well, what is this phenomena and why it happens?
$> 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]