Nodejs request module doesn't send Authorization header

前端 未结 1 826
长发绾君心
长发绾君心 2021-01-25 13:44

I need to send GET request on https url with \"Authorization\" header. I try to do this using this code:

request.get({
  url: url,
  headers: {
    \'Authorizati         


        
1条回答
  •  终归单人心
    2021-01-25 14:18

    Have you tried using auth key? See the details example in the project's readme request.get('http://some.server.com/', { 'auth': { 'user': 'username', 'pass': 'password', 'sendImmediately': false } });

    0 讨论(0)
提交回复
热议问题