请求调用示例

最近更新时间:2022-08-31 18:08:50

查看PDF

事件请求调用示例

  • health check
  curl --location --request GET 'http://127.0.0.1:8080/health'
  • You can try sending a CloudEvent using curl:
curl --location --request POST 'http://127.0.0.1:8080/event-invoke' \
--header 'Content-type: application/cloudevents+json' \
--data '{
    "id": "1",
    "source": "kcs:ks3",
    "type": "ks3:ObjectCreated:PutObject",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "subject": "/",
    "comValue1": "extension value1",
    "comValue2": "extension value2",
    "data": {
        "request": {
            "sourceIPAddress": "127.0.0.1"
        },
        "response": {
            "requestId": "daab11b695ea4c4ea7a1a71ce36d1100"
        },
        "ks3": {
            "bucket": {
                "name": "kcf-pkg",
                "ownerid": "7340"
            },
            "object": {
                "internalurl": "evt-jin.ks3-cn-beijing-internal.ksyuncs.com/a.jpg",
                "etag": "etag-xxxxxxx",
                "objectsize": "1024",
                "url": "evt-jin.ks3-cn-beijing.ksyuncs.com/a.jpg",
                "key": "a.jpg"
            }
        }
    }
}'

HTTP请求调用示例

  • GET调用 curl -X POST http://127.0.0.1:8080/http-invoke
  • POST调用 curl -X POST http://127.0.0.1:8080/http-invoke
    ‘{
    “id”: “a123”,
    }’ //用户自定义body内容
  • PUT调用 curl -X PUT http://127.0.0.1:8080/http-invoke
  • PATCH调用 curl -X PATCH http://127.0.0.1:8080/http-invoke
  • DELETE调用 curl -X DELETE http://127.0.0.1:8080/http-invoke

文档内容是否对您有帮助?

根本没帮助
文档较差
文档一般
文档不错
文档很好

在文档使用中是否遇到以下问题

内容不全,不深入
内容更新不及时
描述不清晰,比较混乱
系统或功能太复杂,缺乏足够的引导
内容冗长

更多建议

0/200

评价建议不能为空

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

问题反馈