Calling an URL without opening Browser

Hi there,I need to call an URL without opening a browser.

In the moment, I’m using this script to open a browser and pass the URL to it:

Shell("rundll32.exe url.dll,FileProtocolHandler " & webadress)

But I’d like to post this URL without opening a browser.

Is there a way to post the call in background?

Thanks in advance,

Buzzy

Subject: I would personally use Java…

Create a new Java-based Agent with the following code:

import java.io.BufferedReader;

import java.io.InputStreamReader;

import java.io.OutputStreamWriter;

import java.net.URL;

import java.net.URLConnection;

import lotus.domino.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {

	try {

		

		String URL = "http://abbr.dominoguru.com/controller";

		URL u = new URL(URL);

		URLConnection uc = u.openConnection();

			uc.setDoOutput(true);

			uc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

			//trying to set custom HTTP Headers

		uc.setRequestProperty("Content-Type", "text/html");

		

		OutputStreamWriter out = new OutputStreamWriter(uc.getOutputStream());

		out.write("");

		out.close();

		

		BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));

		String decodedString;

		

		while ((decodedString = in.readLine()) != null) {

			System.out.println(decodedString);	

		}

		in.close();

		

	} catch(Exception e) {

		e.printStackTrace();

	}

}

}

This will initiate a “blind” HTTP POST Request to the URL defined by the URL variable, pass values defined in the uc.setRequestProperty method, and close down once the HTTP POST is complete.

You can get more out of this by adding the code into a Java Script Library and then including that not only in your Agents but ALSO in any XPages or SSJS Libraries to help “future-proof” the code.

Hope this helps!

-Chris

Subject: Both worth a try…Thank you!

Subject: Not sure if this is what you want…

If you want to navigate to a URL without a browser window being displayed at that point you could do something like this

Dim ie as variant

Set ie = CreateObject(“InternetExplorer.Application”)

ie.Visible = False

ie.Navigate “http://www.ibm.com