create method

Future<NotionResponse> create(
  1. Page page
)

Create a new page.

See more at https://developers.notion.com/reference/post-page

Implementation

Future<NotionResponse> create(Page page) async {
  http.Response res = await http.post(Uri.https(host, '/$v/$path'),
      body: jsonEncode(page.toJson()),
      headers: {
        'Authorization': 'Bearer $token',
        'Content-Type': 'application/json; charset=UTF-8',
        'Notion-Version': dateVersion,
      });

  return NotionResponse.fromResponse(res);
}