Your payload works perfectly fine for me when I try it with Postman against demo.openmrs.org. In the “Body” tab, do you have it set to “Text” or “JSON” (it should be JSON).
Works perfectly fine for me against https://demo.mybahmni.org, but I can replicate the error you received if I have the request type sent to GET instead of POST…
What’s running on port 80 of the machine you are trying to connect to? The error you’re seeing is 100% reproducible if you use http://demo.openmrs.org rather than https://demo.openmrs.org. This is because the response to the initial POST request (on demo.openmrs.org) is:
HTTP/1.1 301 Moved Permanently
Connection: keep-alive
Content-Length: 194
Content-Type: text/html
Date: Mon, 07 Jun 2021 19:13:03 GMT
Location: https://demo.openmrs.org/ws/rest/v1/person/
Server: nginx/1.10.3 (Ubuntu)
Strict-Transport-Security: max-age=15768000
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>
Which then results in Postman doing a GET request to https://demo.openmrs.org/ws/rest/v1/person/ with the request body, which is what gives you the error. For https://demo.openmrs.org, this can be resolved by changing the request from http → https. Presumably doing the same thing with your local server should work…
PS, I discovered this by looking at the Postman console.