1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2025-06-15 00:05:04 +02:00

Add "query database" endpoint

This commit is contained in:
David Stotijn
2021-05-14 23:47:15 +02:00
parent 0c31224d6f
commit 0c1e15e0a7
4 changed files with 278 additions and 4 deletions

View File

@ -52,5 +52,9 @@ func (c *Client) newRequest(method, url string, body io.Reader) (*http.Request,
req.Header.Set("Notion-Version", apiVersion)
req.Header.Set("User-Agent", "go-notion/"+clientVersion)
if method == http.MethodPost || method == http.MethodPatch {
req.Header.Set("Content-Type", "application/json")
}
return req, nil
}