[cse491] HW 6 StartResponse

C. Titus Brown ctb at msu.edu
Sun Oct 18 19:06:53 PDT 2009


On Sun, Oct 18, 2009 at 09:57:59PM -0400, Andrew Kos wrote:
> Good evening,
> I'm confused about what the StartResponse class inside our parse_request()
> definition is for. Why not just have header and status as plain old
> variables inside parse_request instead of inside that class? Also, what
> information is StartResponse.status storing?
> 
> Thank you,
> Andrew Kos

Hi, Andrew,

there may be several ways to do it; as long as your code works for multiple
connections (next week's HW), I am fine with any solution.  This was the
simplest way I found.

Briefly, in order to build the response, the WSGI server needs to retrieve the
status and headers from the WSGI app.  The WSGI app provides this information
to the 'start_response' callable that is passed in; the server must retrieve
the information from that callable.

I could not find a simple clean way to do it with a function, but maybe I
wasn't thinking clearly.

cheers,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list