(res *http.Response, options *requestOptions)
| 156 | } |
| 157 | |
| 158 | func checkContentType(res *http.Response, options *requestOptions) error { |
| 159 | expected := getExpectedContentType(options) |
| 160 | |
| 161 | got := res.Header.Get("Content-Type") |
| 162 | if got != expected { |
| 163 | return errors.Wrapf(ErrContentTypeMismatch, "got: '%s' want: '%s'. Did you configure your endpoint correctly?", got, expected) |
| 164 | } |
| 165 | |
| 166 | return nil |
| 167 | } |
| 168 | |
| 169 | // doReq does a http request to the given path in the api endpoint |
| 170 | func doReq(ctx context.DnoteCtx, method, path, body string, options *requestOptions) (*http.Response, error) { |
no test coverage detected