From 8343db5ae3b311aea1f0c26afff203d9edc20284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Tue, 13 Dec 2022 22:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=8F=8D=E5=90=91HTTP=20POST=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E4=B8=AD=E8=AF=B7=E6=B1=82=E7=9A=84Method=E7=94=B1GET?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BAPOST=20(#1794)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/http.go b/server/http.go index a78102e..6bebc18 100644 --- a/server/http.go +++ b/server/http.go @@ -356,7 +356,7 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) { for i := uint64(0); i <= c.MaxRetries; i++ { // see https://stackoverflow.com/questions/31337891/net-http-http-contentlength-222-with-body-length-0 // we should create a new request for every single post trial - req, err = http.NewRequest(http.MethodGet, c.addr, bytes.NewReader(e.JSONBytes())) + req, err = http.NewRequest(http.MethodPost, c.addr, bytes.NewReader(e.JSONBytes())) if err != nil { log.Warnf("上报 Event 数据到 %v 时创建请求失败: %v", c.addr, err) return