Setting basic authentication information

Top  Previous  Next

Some URL are protected using basic authentication. Using your web browser you can identify URL that require basic authentication as those that prompt you with a dialog box similar to the one displayed in the authentication dialog displayed below.

 

To access the URL you must enter a username and password that is recognized by the HTTP server for the specified URL. The supplied username and password are sent to the HTTP server as an encoded HTTP header.

 

Using the HTTP component you can access password protected URL by invoking the HttpRequest#setBasicAuthentication method providing the username and password as arguments.

 

Example

 

// set username and password for basic authentication

request.setBasicAuthentication("jsmith","secret");

 

 

 





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC