copyPage method

Future<Map> copyPage({
  1. required String access_token,
  2. required String path,
  3. String? title,
  4. String? author_name,
  5. String? author_url,
  6. bool return_content = true,
  7. Client? httpClient,
})

Implementation

Future<Map> copyPage({
  required String access_token,
  required String path,
  String? title,
  String? author_name,
  String? author_url,
  bool return_content = true,
  Client? httpClient,
}) async {
  Map page_data = await getPage(path: path, return_content: true);
  return await createPage(
    access_token: access_token,
    title: title ?? page_data["title"] ?? DateTime.now().toString(),
    author_name: author_name,
    author_url: author_url,
    content: page_data["content"],
    return_content: return_content,
  );
}