[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yet another feature request for the web-server



On Wed, Sep 05, 2001 at 01:01:28PM -0400, Eli Barzilay wrote:
> On Sep  5, Francisco Solsona wrote:
> > 
> > Right, lets forget about having access directly to the output stream.
> 
> Note that in some rare cases you might still want that.  For example,
> you might want to spit out a file's contents directly on the page (not
> sending a file by itself which is handled elsewhere) -- accumulating
> it in memory before sending might not be feasible.
> 
> 
> > One obvious way to overcome this is to implement the META tag:
> > 
> > http://www.htmlhelp.com/reference/wilbur/head/meta.html
> > 
> > it would be simple enough to parse the (head ...) section of the
> > Xexpr, in search of META tags to transform into headers.
> 
> That's a nice idea.
> 
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                   http://www.barzilay.org/                 Maze is Life!


I'd rather not rely on META tags, since they don't work for non HTML media
types.

In the unreleased version-200 release of the server, I extended the possible
result types from an x-expression to either
  - an x-expression
  - a (listof string) where the first string is a mime type
    and the rest are content
  - a structure of type
    (make-response/full nat str nat str (listof (cons sym str))
					(listof str))
    defined by
    (define-struct response/full (code message seconds mime extras body))

    where code is the HTTP reply code (i.e. 200 is okay, 400 is an error)
          message is an arbitrary one line description of the code ("Not Found")
          seconds is the modification time (i.e. (current-seconds))
          mime is the mime type (i.e. "text/html")
          extras are aribitrary headers (i.e. for setting cookies)
          body is the contents

The last option should specify everything anyone would ever need to, given
the current HTTP/1.1 spec.  The others are for common cases.

If others have suggestions/objections, please let me know before version 200
goes out.

Thanks,

Paul