Changeset 27921 in project


Ignore:
Timestamp:
12/11/12 06:17:09 (7 years ago)
Author:
Peter Danenberg
Message:

Update docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/call-with-query

    r27804 r27921  
    2828</enscript>
    2929Anything written to stdout appears in the request;
    30 anything to stderr goes in the server logs; while
    31 {{display-content-type-&c.}} takes care of the HTTP headers.
     30anything to stderr goes in the server logs; while {{display-content-type-&c.}}
     31 takes care of the HTTP headers.
    3232
    3333
    3434=== Documentation
     35==== {{display-content-type-&c.}}
     36<procedure>(display-content-type-&c.) → unspecified</procedure>
     37<procedure>(display-content-type-&c. content-type-&c.) → unspecified</procedure>
     38Write the content-type headers and e.g. XML prolog (if
     39necessary); do not, however, write the status (see {{display-status}}
     40and {{display-status-&c.}}).
     41
     42Valid content-types are {{xhtml}}, {{html}}, {{text}}, {{json}},{{png}}.
     43; content-type-&c. : The content-type-and--prolog, e.g. {{xhtml}}
     44<enscript highlight="scheme">(define display-content-type-&c.
     45  (case-lambda
     46    (() (display-content-type-&c. (default-content-type-&c.)))
     47    ((content-type-&c.) ((alist-ref content-type-&cs. content-type-&c.)))))
     48</enscript>
     49==== {{display-status-&c.}}
     50<procedure>(display-status-&c.) → unspecified</procedure>
     51<procedure>(display-status-&c. status) → unspecified</procedure>
     52<procedure>(display-status-&c. status content-type . rest) → unspecified</procedure>
     53Display the status, content-type and prolog.
     54; status : Status code, e.g. {{status-no-content}} or 204
     55; content-type : Content-type, e.g. {{xhtml}}
     56; rest : Optional arguments to the status, e.g. {{location}} in the case of 300
     57<enscript highlight="scheme">(define display-status-&c.
     58  (case-lambda
     59    (() (display-status-&c. (default-status)))
     60    ((status) (display-status-&c. status (default-content-type)))
     61    ((status content-type . rest)
     62     (display-status status)
     63     (apply (alist-ref/default statuses status void) rest)
     64     (display-content-type-&c. content-type))))
     65</enscript>
    3566==== {{query-client-any}}
    3667<procedure>(query-client-any query key) → string</procedure>
     
    165196
    166197Documented by [[/egg/cock|cock]].
    167 Return the first client parameter (e.g. {get,post,cookie}-parameter)
    168 corresponding to the key.
    169 ; key : The key whose value to extract
    170 ; default : A default value if {{key}} doesn't exist
    171 /procedureContent-type: application/json\r\n\r\nscheme
Note: See TracChangeset for help on using the changeset viewer.