From f0c93fa78278d9efdbb31bc00802ae4e3f3862e9 Mon Sep 17 00:00:00 2001 From: Samuel Jimenez Date: Thu, 4 Jun 2020 12:44:36 +0200 Subject: [PATCH] Add 'application/json' as content media type --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 7a8b3d28..32373f4e 100644 --- a/client.go +++ b/client.go @@ -185,7 +185,8 @@ func (c Client) sendRequest(req *internalRequest, internalError *Error) (*http.R return nil, internalError.WithErrCode(ErrCodeRequestCreation, err) } - // adding apikey to the request + // adding request headers + request.Header.Set("Content-Type", "application/json") if c.config.APIKey != "" { request.Header.Set("X-Meili-API-Key", c.config.APIKey) }