declare @iobject int,
@ihr int,
@data nvarchar(4000) ,
@smtpWebService varchar(200),
@retVal varchar(8000),
@src varchar(1000),
@desc varchar(1000)
exec @ihr = sp_oaCreate 'Msxml2.ServerXMLHTTP.3.0', @iobject OUTPUT
if (@ihr <> 0)
begin
exec sp_displayoaerrorinfo @iobject, @ihr return
end
set @data = 'boo=yeah'
set @smtpWebService = 'http://www.google.com'
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
if @ihr <> 0
begin
exec sp_OAGetErrorInfo @iobject, @src OUT, @desc OUT
select hr = convert(varbinary(4),@ihr), Source = @src, Description = @desc
--raiserror('Error Creating COM Component 0x%x, %s, %s',16,1, @ihr, @src, @desc) return
print @src
print @desc
end
exec @ihr = sp_OAGetProperty @iObject, 'responseText', @retVal OUT
print @retVal
-- Destroy the object
exec @ihr = sp_OADestroy @iobject
Subscribe to:
Post Comments (Atom)

1 comment:
How do you work it with SSL? I tried an "https" url but no dice.
Post a Comment