简体   繁体   中英

fastcgi++: Client sent unknown content type

Have written simple server using fastcgi++ 2.1 lib and configured fastscgi in apache2 web server. When I make post request to the server with Content Type: application/json, server throws an internal server error. Have checked apache error.log file and found following log:

[Wed Jan 08 13:56:40 2014] [error] [client 127.0.0.1] FastCGI: server "/var/www/testserver" stderr: "Client sent unknown content type." from " http://abcd.com/testserver " with a POST request method.

When I set Content Type to "application/x-www-form-urlencoded" its working fine and request get served. Please help me on how to serve request with Content Type as "application/json". Is there any configuration required for this to support?

Yeah solved !

In fastcgi++ lib, Content Type "application/x-www-form-urlencoded" is hard-coded. Have changed it to "application/json" and rebuild the fastcgi++ lib. Now I'm able to serve request with Content Type "application/json".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM