I am trying to query issues using the JIRA REST API, and with my desired JQL query, I was getting no results. By looking at the headers with the -v option to curl, it transpired that when I pass the -n option, it would never send the Authentication header. This is because this JIRA instance allows anonymous access, so it never issues the basic authentication challenge response which would prompt curl to send the username and password I specified in my .netrc file. Unfortunately, anonymous users cannot see the issues I wish to query, so I need to force authentication.
Using the -u option to curl to specify my JIRA username and password on the command line works, but I do not wish to do this in general, because that would mean that my password would be visible on my screen, in my bash history, etc.
I have tried adding other options to the command line, but they don't help.