I have a question regarding the use of the PUT request.
I currently have a C application that runs as a FastCGI application. The FastCGI configuration in hiawatha.conf is essentially similar to that described in an
earlier forum post. It uses URL rewrites.
It is my understanding that Hiawatha
does not support the PUT request for URL rewrites. Per the RFC standards:
" If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. " -- from
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6Now, I would like to use the PUT request with my FastCGI application (called myApp.cgi) to modify an already existing resource - as in # curl --request PUT --data "newState" http://<URL>/state, for instance, with regards to RESTful.
How can I configure Hiawatha in such a way that URL re-writes are turned off and use PUT requests?
With URL re-writes turned off and use of AlterList to allow use of PUT requests with the myApp.cgi, here is the FastCGIServer and VirtualHost configuration.
FastCGIserver {
FastCGIid = QmyApp
# 2005 is the FastCGI socket that myApp.cgi uses.
ConnectTo = 127.0.0.1:2005
SessionTimeout = 30
Extension = cgi
}
VirtualHost {
Hostname = 127.0.0.1
WebsiteRoot = /home/user/myAppLocation
StartFile = index.html
AccessLogfile = /home/user/myAppLocation/logs/access.log
ErrorLogfile = /home/user/myAppLocation/logs/error.log
AlterGroup = myAppUsers
AlterList = allow 127.0.0.1
AlterMode = 640
RunOnAlter = /home/user/myAppLocation/myApp.cgi
UseFastCGI = QmyApp
ExecuteCGI = yes
}
With URL re-writes turned off, my strategy would be to parse the environment variable REQUEST_URI to obtain the resource to be modified, if the environment variable REQUEST_METHOD has the value "PUT".
However, Hiawatha is not updating the environment variable REQUEST_METHOD, when a PUT request is received. Is there anything I'm doing wrong?
Thanks!
Hiawatha version: 8.8
Operating System: Linux