How can we read the parameter par1 set into the Header?
Using a simple call code action (ran on Notes client -> Action):
Dim session As New NotesSession
Dim webRequest As NotesHTTPRequest
Dim url as String
Dim out as string
Set webRequest = session.CreateHTTPRequest()
Call webRequest.SetHeaderField("par1", |testblabbla|)
This is the NotesAgent
Dim s As NotesSession
Dim doc As NotesDocument
Set s = New NotesSession
Set doc = s.documentcontext
If doc.QUERY_STRING_DECODED(0)<>"" Then'it's a GET
myQuerystring = doc.QUERY_STRING_DECODED(0)+"&cond=1"
ElseIf doc.QUERY_STRING(0)<>"" Then
myQuerystring = doc.QUERY_STRING(0)+"&cond=2"
'decode it !
ElseIf doc.REQUEST_CONTENT(0)<>"" Then'it's a POST
myQuerystring = doc.REQUEST_CONTENT(0)+"&cond=3" ' WARNING this is for POST but you will have to decode !!!
'decode it !
the generated output for the agent
Apparently CGI doesn't provide a mean to expose custom headers. And the headers are meant to be directives for the end or intermediate devices to act upon if they're interested. The application-specific data should go to where the application can get to.
The suggestion at this time:
a) adding this name-value pair as URL params and use Query_String_Decoded to get to this.
b) If the value gets too long, you can do a POST and shove this name-value in to the Http payload. The document context would have this Notes field/value because that's where the application is expected to get it.
Please consider whether to extend the CGI or something else within a NotesAgent in order to read these headers.