I was not able to reproduce your issue on a fresh install of ES 5.1.1 using the below script.
Could you paste the complete request you are sending, the response JSON you receive and the stack trace you'll get in your server logs for this? Also, is this a fresh install of ES 5.1.1 or have you upgraded it from 2.x?
Thanks
Colin