SQL Server定时调用指定WebApi接口
DECLARE @ApiUrl VARCHAR(2000)
DECLARE @RequestType VARCHAR(5)
DECLARE @ResponseText NVARCHAR(4000)
SET @ApiUrl = 'http://192.168.1.169/sit-qualityapi/QC_ExceptionRecord/SendOAMessage_ExceptionRecord'
SET @RequestType = 'POST'
EXEC Proc_CallWebApi @ApiUrl,@RequestType, @ResponseText OUTPUT
/****** Object: StoredProcedure [dbo].[Proc_CallWebApi] Script Date: 1/8/2024 2:36:11 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Proc_CallWebApi]
-- Add the parameters for the stored procedure here
@ApiUrl VARCHAR(200), --api请求地址
@RequestType VARCHAR(5),--请求类型:POST,GET
@ResponseText NVARCHAR(4000) OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT stateme