Lotus Script: Reading data received from HTTP GET and POST

 

When we receive data based on HTTP GET it is direct available on URL.

When we receive data based on HTTP`POST it is within HTTP package body.

Lets see here how an Agent from a IBM Lotus Notes Application can be read these values When it is called from na HTTP Client.

The first concept you have to know is that Notes agents can be called based on HTTP request from its URL: https://<url_db>.nsf/<your_agent_name>?OpenAgent. This parameter ?OpenAgent is mandatory to start the agent execution.

Then within the agent with have access from HTTP request through the documentContext variable which is read from current NotesSession object. And this document has Fields based on CGI, which there are two special fields for the purpose we write here:

·        Request_Content: contains the data sent by HTTP POST.

·        Query_String_Decoded: contains the data sent by HTTP GET.

Here a code example:

Dim urlParametersGET As String

Dim contentPOST As String

Set session = New NotesSession

Set db = session.Currentdatabase

Set docContext = session.Documentcontext

contentPOST = docContext.Request_Content(0)

urlParametersGET  = docContext.Query_String_Decoded(0)

Comments

Popular posts from this blog

Dart/Flutter: exception handling

Dart: implementing Object Oriented Programming (OOP)

Android – SearchView: Adding a Search component direct on your APP menu.