()
| 136 | } |
| 137 | |
| 138 | func createHeader() httpclient.AuroraHeaders { |
| 139 | header := make(httpclient.AuroraHeaders) |
| 140 | header.Set("accept-language", "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7") |
| 141 | header.Set("content-type", "application/json") |
| 142 | header.Set("origin", "https://duck.ai") |
| 143 | header.Set("referer", "https://duck.ai/") |
| 144 | header.Set("sec-ch-ua", `"Chromium";v="148", "Google Chrome";v="148", "Not/A)Brand";v="99"`) |
| 145 | header.Set("sec-ch-ua-mobile", "?0") |
| 146 | header.Set("sec-ch-ua-platform", `"Windows"`) |
| 147 | header.Set("sec-fetch-dest", "empty") |
| 148 | header.Set("sec-fetch-mode", "cors") |
| 149 | header.Set("sec-fetch-site", "same-origin") |
| 150 | header.Set("user-agent", UA) |
| 151 | return header |
| 152 | } |
| 153 | |
| 154 | func postConversationOnce(client httpclient.AuroraHttpClient, request duckgotypes.ApiRequest, token string) (*http.Response, error) { |
| 155 | bodyJSON, err := json.Marshal(request) |
no test coverage detected