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.