From cUrl docs:
-u, --user Specify the user name, password and optional login options to use for server authentication. Overri
There is an easier way to do. Do it this way
curl "http://user:pass@www.example.com"