We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
got.post ...
What may I be missing here for a simple POST that is throwing a 401?
Thanks!
const options = { https: { rejectUnauthorized: settings.ssl }, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'vmware-use-header-authn': settings.username, 'vmware-api-session-id': undefined, }, username: settings.username, password: settings.password, } const response = await got.post(url, options);
The text was updated successfully, but these errors were encountered:
#1351 and/or #1169. Try passing an authorization header instead.
authorization
Sorry, something went wrong.
Thanks @szmarczak !! That did the trick!
const options = { https: { rejectUnauthorized: settings.ssl }, headers: { 'Authorization': "Basic " + Buffer.from(settings.username + ':' + settings.password).toString("base64"), 'Content-Type': 'application/json', 'Accept': 'application/json', 'vmware-api-session-id': undefined, } } const response = await got.post(url, options);
No branches or pull requests
What would you like to discuss?
got.post
...
Checklist
Hello,
What may I be missing here for a simple POST that is throwing a 401?
Thanks!
The text was updated successfully, but these errors were encountered: