嗨,我如何使用这个基于 json 的 API 在 android 中正确发出 HTTP post 请求。
curl -H "Content-type: application/json" -X POST \
-d '{
"service_key": "e93facc04764012d7bfb002500d5d1a6",
"incident_key": "srv01/HTTP",
"event_type": "trigger",
"description": "FAILURE for production/HTTP on machine srv01.acme.com"
}
}' \
"https://events.pagerduty.com/generic/2010-04-15/create_event.json"
我有这个代码,但它给了我 400 的状态错误 - https://gist.github.com/26af7af09b509c0e8c2a#comments