Esempio n. 1
0
    public static SqlInt32 APICaller_GET_Extended(SqlString URL, SqlString JsonBody, SqlString Headers)
    {
        SqlInt32 ExecutionResult = APIConsumer.DEFAULT_EXECUTION_RESULT;

        API_Consumer.ExtendedResult ExtResult = new API_Consumer.ExtendedResult();

        try
        {
            string Result = APIConsumer.GETMethod_Extended(ref ExtResult, URL.ToString(), JsonBody.ToString(), Headers.ToString());

            Helper.SendResultValue(ExtResult);
        }
        catch (Exception ex)
        {
            Helper.SendResultValue(ExtResult);
            ExecutionResult = APIConsumer.FAILED_EXECUTION_RESULT;
        }

        return(ExecutionResult);
    }
    public static SqlInt32 APICaller_POST_Extended(SqlString URL, SqlString Headers, SqlString JsonBody)
    {
        SqlInt32 ExecutionResult = APIConsumer.DEFAULT_EXECUTION_RESULT;

        try
        {
            API_Consumer.ExtendedResult ExtResult = new API_Consumer.ExtendedResult();

            string Result = APIConsumer.POSTMethod_Extended(ref ExtResult, URL.ToString(), JsonBody.ToString(), Headers.ToString());

            Helper.SendResultValue(APIConsumer.DEFAULT_COLUMN_RESULT, Result);
        }
        catch (Exception ex)
        {
            Helper.SendResultValue(APIConsumer.DEFAULT_COLUMN_ERROR, ex.Message.ToString());
            ExecutionResult = APIConsumer.FAILED_EXECUTION_RESULT;
        }

        return(ExecutionResult);
    }