Closed ae3e closed 4 years ago
Hi @ae3e Im happy to add the option to add the headers. Could you help me providing a backend code or site where I could test it against?
Thanks for your quick answer. You could use Posman-echo to test any web requests. More specifically, you can test headers and basic authentication.
Thx for pointing me to that service. Superuseful! I had a look already and it's working.
I'll upload tonight a testing version with a more generic HTTP request function :)
Thanks a lot! I never compiled PHONK by myself so I'll wait for your next release to test it (unless it takes too long... i'll try to compile it! 😉)
I will do my best to release a new version tonight, I'll ping you here once done :)
Hi @ae3e I uploaded a release here https://github.com/victordiaz/PHONK/releases/tag/1.3.1 You can try the following code
// the concatenation needs a .toString() there is a strange behaviour otherwise
var auth = ('Basic ' + util.stringToBase64('postman:password')).toString()
var req = network.httpRequest({
method: 'GET',
url: 'https://postman-echo.com/basic-auth',
headers: {
Authorization: auth
},
}).onResponse(function (e) {
console.log(e)
})
Let me know if does work for you :)
Thanks, I just tested it with some home automation devices that need authentication and it works perfectly! You're really doing a great work! 👍
I have a web request with basic authentication so I need to had
Authorization :
header