First test: Navigate Webform and additional headers?

57 Views Asked by At

I tried a tutorial from Phalanger with a Webbrowser and it works! :) But now I tried to autologin to a website but I can not send additional authentification headers with the Windows Webform control. It gives me method not found! Did I miss s/th?

$authData = "[email protected]:test"; 
$authHeader = "Authorization: Basic " + base64_encode($authData) + "\r\n" + "User-Agent: MyUserAgent\r\n";
$this->browser->navigate($url,"",null,$authHeader);

I looked in the documentation and Windows Webforms Navigate method takes 4 variables but it gives me always method not found! I also tried it also with

$authData = utf8_encode("[email protected]:test");

but this give me error function utf8_encode not found? Sorry, if it's dumb question. Thanks.

Edit: Exception details:

PHP.Core.PhpException was unhandled by user code
Message: An exception of type 'PHP.Core.PhpException' occurred in PhpNetCore.dll but was not handled in user code
Additional information: Call to undefined function: 'test\utf8_encode'
0

There are 0 best solutions below