Be very careful not to include your username and password in a git-saved file, if necessary put them in a separate file listed in .gitignore and read the content using source().
Of course, you can build the url using paste0() or other functions.
Hi jk3234, first, since your question is different from the previous one I would recommend starting a new thread.
As to your problem, sorry, I have no idea, you could try using url() which seems to have worked here. Also, are you in exactly the same case as above, with an API that expects a GET request, do you have a proxy or antivirus that could restrict the connection, etc... ?