ethanent / phin

Node HTTP client
MIT License
576 stars 33 forks source link

How to use basic auth that is part of URL #77

Open ASaiAnudeep opened 3 years ago

ASaiAnudeep commented 3 years ago

How can we pass basic auth credentials as part of the request url?

Example:

https://admin:admin@the-internet.herokuapp.com/basic_auth

const p = require('phin');

await p({
  url: 'https://admin:admin@the-internet.herokuapp.com/basic_auth',
  method: 'GET'
})
ethanent commented 3 years ago

I'll do some research, create a test case, and get back to you on this.

ASaiAnudeep commented 2 years ago

We need to handle it in centra in this way - https://stackoverflow.com/a/11853077/5401310

AlexeyCL commented 2 years ago

@ASaiAnudeep you can look at my issue, I added the workaround, and it works for me.