How to use POST method to send http request

Hi all, I need to send an http request and to use POST method for sending the parameters (eg: username and password) and i have to retrieve the http response. All these things should be done in notes client and not in web client. Can anyone help me with the code for using POST method for sending vales.

Thanks in advance,

Fraser.

Subject: How to use POST method to send http request

Maybe you can explain what you tried to accomplish. There may be other solutions ???

Subject: RE: How to use POST method to send http request

Hello,

Rightly said, It can be accomplished in a number of ways. Let us know your scenario and then we can discuss, what probably will be right.

Best Regards,

Munish Kaushik

Subject: How to use POST method to send http request

Hi, Thanks for ur reply Rusyinni & Munish. See my requirement goes like this. I have to use POST method to send the username and password to the url. That will return an text message. So how can i send the username and password using post method. As i said earlier this application should work in notes client not in web.

Subject: RE: How to use POST method to send http request

Hi Angus,

Here’s how you can do this…

Sub Initialize

Dim s As New NotesSession

Dim doc As NotesDocument

Dim objHttp As Variant

Dim response As String

Dim request As String

Set db = s.CurrentDatabase

Set doc = s.DocumentContext

Dim objXMLHTTP, objXMLDOM, objTitles, objURLs, i

Set objHttp = CreateObject(“Microsoft.XMLHTTP”)

url = |http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb?readviewentries|

req = |<?xml version="1.0" encoding="UTF-8" ?>iiii|

objHttp.open “POST”, url, False, “”, “”

objHttp.setRequestHeader “Content-type”, “application/x-www-form-urlencoded”

objHttp.send(req)

Set xmlDoc = CreateObject(“Msxml2.DOMDocument”)

xmlDoc.loadXML (objHttp.ResponseText)

Set xmlLst = xmlDoc.getElementsByTagName(“viewentry”)

For i = 0 To xmlLst.length - 1

Set newdoc = New notesdocument(db)

newdoc.form=“docfromxml”

Set xmlNode = xmlLst.Item(i)

Set att=xmlnode.childnodes

Forall child In att

Call newdoc.replaceitemvalue(child.nodename,child.text)

End Forall

Call newdoc.save(True,False)

Next

End Sub

For further information, you can use this link…

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/a4800900bb2e919785256e2100501797?OpenDocument

Hope this helps…

Best Regards,

Munish Kaushik