sp_OAMethod

7 views
Skip to first unread message

Tito

unread,
Jul 31, 2020, 5:08:55 PM7/31/20
to
Greetings,

I have a need to call a rest api against a resource. It a POST and would like to send the following as POST option

http.post(url,
'{
"https": { rejectUnauthorized: settings.ssl },
"headers": {
"Authorization": "BASIC dfsdkfdsfyduyfiuhdfiuyu5y43=",
"Content-Type": "application/json",
"Accept": "application/json"
}
}'
)

Tried to this but it fails

EXEC @ret = sp_OAMethod @token, 'open', NULL, 'POST', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Authentication', @authHeader;
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'https', '{"rejectUnauthorized":"false"}';
EXEC @ret = sp_OAMethod @token, 'send', NULL, null;
Reply all
Reply to author
Forward
0 new messages