| 1234567891011121314 |
- #!/usr/bin/env groovy
- import groovy.json.JsonOutput
- def send(String webhook, Map card) {
- // webhook 必须是纯字符串,不能再出现 credentials()
- httpRequest(
- httpMode: 'POST',
- requestBody: JsonOutput.toJson([msg_type: 'interactive', card: card]),
- contentType: 'APPLICATION_JSON',
- url: webhook, // 这里一定是合法 URL
- consoleLogResponseBody: true,
- validResponseCodes: '200'
- )
- }
|