Response to http post

Iam trying to read the data sent through http post using an agent.Iam getting the data from request_content variable.How do I send a response back to the http post for a success or failure.

Subject: response to http post

Lotus script agent or Java agent?
Lotus Script:
Print “h2>This is reponse from server]”
give special attention to square bracket surrounding the text.

In Java agent, get a PrintWriter
import java.io.PrintWriter;
PrintWriter pw = getAgentOutput();
pw.println(“[Reponse from server]”);

Regards
Byju Joy

Subject: RE: response to http post

Thanks for your response.Its a lotus script agent.I’ve coded the agent to receive the data sent through the http post from the doc.request_content(0).And then I decode the data and save it in a document.Thats the flow of the agent.Where do I add this statement for sending a reply back to the person who did the http post.Should I add this statement at the end of the agent so that it will be posted back to the same address from which I received the data…correct me if Iam wrong.

Subject: RE: response to http post

Yes, put the print statement at the end of your agent code and you should be fine.

Also take a look at the HTML source generated by the agent. You will see that Domino generates some basic HTML framework around what you print out. But, if you have to fulfill certain accessibility requirements (Section 508, WAI, …) this might not be good enough (which might can also happen with Domino generated HTML otherwise).

If you start your print statements with Print | … or - even better - with Print |<!DOCTYPE … , Domino will refrain from generating this stuff on its own.

Putting out HTML in print statements can be cumbersome. There are a number of alterternatives, e.g. redirecting the user to another page or form. To do so, print out a URL and enclose it in square brackets, like so:

Print |[http://www.caterham.co.uk]|

If you need to carry over some specific information, you could do so by adding URL parameters, which the target form would need to read out and display in an appropriate manner.