Using a netrc file in curl is useful to avoid typing your password for each new request.
The syntax of your netrc file is as follows :
If you log in using any LDAP-based authentication, make sure to add the DOMAIN.
Make sure to change the permissions on your netrc file :
chmod 600 netrc
By default, curl looks for a netrc file in your home directory.
If needed, you can manually mention the location of your netrc file :
curl --netrc-file mynetrc