[mod_python] Setting content location

Robert Leftwich robert at leftwich.info
Thu Apr 17 08:54:50 EST 2003

I'm a newbie playing with mod_python (which I think is great, so far at 
least :-)) and I need to set a header to be returned to the client after 
processing an http post request. In my case I want to set the 
Content-Location header to a newly created URL  (fyi I'm attempting to 
implement a REST-based web service) and I have the following code in the 
handler :

def handler(req):
     if req.method == 'POST':
         req.headers_out["Content-Location"] = "/foo/bar"
         return apache.HTTP_CREATED

But I don't see the Content-Location header being set in my client. What am 
I missing?


More information about the Mod_python mailing list