How to create a child page for a confluence page using rest API in confluence server?

I am working on this ticket https://jira.castsoftware.com/browse/SERVTOOL-4.
I need to copy confluence page including child pages.
How to achieve this in confluence server?

I am trying to Create a new page as a child of another page.

As per Confluence Server Documentation. This example shows how you can create a new page, with content, as a child of another page with ID 456

curl -u admin:admin -X POST -H ‘Content-Type: application/json’ -d ‘{“type”:“page”,“title”:“new page”,
“ancestors”:[{“id”:456}], “space”:{“key”:“TST”},“body”:{“storage”:{“value”:

This is a new page

”,“representation”:“storage”}}}’
http//localhost:8080/confluence/rest/api/content/ | python -mjson.tool

but i am getting “405 method not allowed”.

Can anyone help me please?

documentation link is here
https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/#create-a-new-page-as-a-child-of-another-page