(httpMethod string, suffix string, reqBytes []byte)
| 8 | ) |
| 9 | |
| 10 | func Send(httpMethod string, suffix string, reqBytes []byte) (body []byte, err error) { |
| 11 | req, err := http.NewRequest(httpMethod, common.GlobalObject.Qdrant.Host+suffix, bytes.NewBuffer(reqBytes)) |
| 12 | if err != nil { |
| 13 | return |
| 14 | } |
| 15 | |
| 16 | req.Header.Add("Content-Type", "application/json") |
| 17 | |
| 18 | client := &http.Client{} |
| 19 | resp, err := client.Do(req) |
| 20 | if err != nil { |
| 21 | return |
| 22 | } |
| 23 | defer resp.Body.Close() |
| 24 | |
| 25 | body, err = io.ReadAll(resp.Body) |
| 26 | return |
| 27 | } |
| 28 | |
| 29 | type CommonResponse struct { |
| 30 | Result interface{} `json:"result"` |
no outgoing calls
no test coverage detected