I am creating a RESTful API in PHP, and have encountered a problem. When the client is posting data to the server, the server should return:
Status code 201
I had similar problem with WP REST API on IIS 8.5. Following html
Document Moved
Object Moved
This document may be found
here
was added at start of every json returned with Location header and status 201 Created. Content-Type was changed to text/html; charset=UTF-8.
Adding cgi.rfc2616_headers = 1 in php.ini resulted with:
200 OKI wouldn't call this solution, this is more replacing one problem with another. Luckily this new problem in my situation was smaller than original one.