(ctx context.Context, method string, url string, body []byte)
| 57 | |
| 58 | } |
| 59 | func doRequest(ctx context.Context, method string, url string, body []byte) (*http.Response, error) { |
| 60 | |
| 61 | request, err := http.NewRequestWithContext(ctx, method, url, bytes.NewReader(body)) |
| 62 | if err != nil { |
| 63 | return nil, err |
| 64 | } |
| 65 | |
| 66 | request.Header.Set("User-Agent", "aoplatform") |
| 67 | request.Header.Set("content-type", "application/json") |
| 68 | return httpClient.Do(request) |
| 69 | } |