How to Check That Username Password Is Correct Using Curl Command?
I Want to Be Able to Write a Curl Command Where in I Pass Options Like Username Password in the Curl Itself and It Should Connect to the Server. Is There a Way...
I want to be able to write a curl command where in i pass options like username password in the curl itself and it should connect to the server. Is there a way where we can find if the user is able to connect to that mentioned server? That means it should throw some error while I run the curl, if the credentials are incorrect. I was trying the below :-
curl --silent -k --digest -u "admin:admin" ""
But this return nothing.
1 Answer
According to man curl the reason you're getting no response is --silent, as expected:
Silent or quiet mode. Don't show progress meter or error mes‐
sages. Makes Curl mute. It will still output the data you ask
for, potentially even to the terminal/stdout unless you redirect
it.
If you don't want the progress meter, the likely reason you chose to add --silent, but you want to see the error messages then you must use -S additionally.