1
Hello, How do I get a post request by passing an xml as date? tried so on another GET request and it worked:
DECLARE @Tabela TABLE ( CampoXML XML);
DECLARE @URL VARCHAR(8000)
SELECT @URL = 'url?parametros='
DECLARE @Response varchar(8000)
DECLARE @XML xml
DECLARE @Obj int
DECLARE @Result int
DECLARE @HTTPStatus int
DECLARE @ErrorMsg varchar(MAX)
EXEC @Result = sp_OACreate 'MSXML2.XMLHttp', @Obj OUT
EXEC @Result = sp_OAMethod @Obj, 'open', NULL, 'GET', @URL, false
EXEC @Result = sp_OAMethod @Obj, 'setRequestHeader', NULL, 'Content-Type', 'application/x-www-form-urlencoded'
EXEC @Result = sp_OAMethod @Obj, send, NULL, ''
EXEC @Result = sp_OAGetProperty @Obj, 'status', @HTTPStatus OUT
INSERT @Tabela ( CampoXML )
EXEC @Result = sp_OAGetProperty @Obj, 'responseXML.xml'--, @Response OUT
SELECT * FROM @Tabela
but I need to do a post request, and pass body the xml below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<acertaContratoEntrada xmlns="http://...">
<usuario>usuario</usuario>
<senha>senha</senha>
</acertaContratoEntrada>
I appreciate the answers