• sp_OAMethod

    From Tito@21:1/5 to All on Fri Jul 31 14:08:51 2020
    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;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)