HTTP Post in SQL server 2005

N

Nick Chan

hello, i have this summarized stored proc. Problem is, when using
'Send', my aspx page reads (asp.net)Request.Form as empty

However, when I use a simple html file to post, it works. Does anyone
know what's wrong?

EXEC @iHr = sp_oaCreate 'Msxml2.ServerXMLHTTP.3.0',@iObject OUTPUT

declare @data as nvarchar(max)
set @data = 'boo=yeah'

EXEC @iHr = sp_OAMethod @iObject, 'Open', null,
'POST',@smtpWebService, 0

EXEC @iHr = sp_OAMethod @iObject, 'setRequestHeader', null, 'Content-
Type', 'application/x-www-form-urlencoded'

EXEC @iHr = sp_OAMethod @iObject, 'send',null,@data

while @State<>4
begin
exec sp_oagetproperty @iObject, 'readyState', @State output
end

EXEC @iHr = sp_OAGetProperty @iObject, 'responseText',@retVal OUT

print @retVal

EXEC sp_OADestroy @iObject
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top