Changeset 781
- Timestamp:
- 11/02/05 19:19:04
- Files:
-
- trunk/docs/book/xml/apireference.xml (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docs/book/xml/apireference.xml
r753 r781 177 177 Instead, it should be used to determine which features are <emphasis>available</emphasis> 178 178 for the response. For example, an HTTP server may send an HTTP/1.1 response even though 179 the client is known to only understand HTTP/1.0 —the response.version will be set to179 the client is known to only understand HTTP/1.0the response.version will be set to 180 180 Version("1.0") to inform you of this, so that you (and CherryPy) can restrict the 181 181 response to HTTP/1.0 features only.</para> … … 280 280 <section> 281 281 <title>cherrypy.server.stop()</title> 282 <para>Stop the CherryPy Server. Well, "suspend" might be a better term —this doesn't282 <para>Stop the CherryPy Server. Well, "suspend" might be a better termthis doesn't 283 283 terminate the process.</para> 284 284 </section> … … 314 314 <section> 315 315 <title>cherrypy.server.request()</title> 316 <para>HTTP servers should call this function to hand off the HTTP request to the CherryPy317 core. There is no return value; instead, the core sets response content inthe318 cherrypy.response object.</para>316 <para>HTTP servers should call this function to create a new Request and Response object. 317 The return value is the Request object; call its <code>run</code> method to have the 318 CherryPy core process the request data and populate the response.</para> 319 319 </section> 320 320 </section> … … 341 341 file.</para> 342 342 </section> 343 <section> 344 <title>cherrypy.config.environments</title> 345 <para>Dict containing config defaults for each named server.environment.</para> 346 </section> 343 347 </section> 344 348 <section id="exceptions"> … … 351 355 <title>cherrypy.NotFound</title> 352 356 <para>This exception is raised when CherryPy is unable to map a requested path to an 353 internal method. It's a subclass of HTTPError .</para>357 internal method. It's a subclass of HTTPError (404).</para> 354 358 </section> 355 359 </section> … … 379 383 <para>Utility class that restores positional parameters functionality that was found 380 384 in 2.0.0-beta.</para> 385 </section> 386 <section> 387 <title>getAccept(headername)</title> 388 <para>Returns a list of AcceptValue objects from the specified Accept-* header (or 389 None if the header is not present). The list is sorted so that the most-preferred 390 values are first in the list.</para> 391 <para>Each AcceptValue object has a <code>value</code> attribute, a string which is 392 the value itself. For example, if <code>headername</code> is "Accept-Encoding", the 393 <code>value</code> attribute might be "gzip". It also has a (read-only) 394 <code>qvalue</code> attribute, a float between 0 and 1 which specifies the client's 395 preference for the value; higher numbers are preferred. Finally, each AcceptValue 396 also has a <code>params</code> attribute, a dict; for most headers, this dict will 397 only possess the original "q" value as a string.</para> 398 <para>If <code>headername</code> is "Accept" (the default), then the params attribute 399 may contain extra parameters which further differentiate the value. In addition, 400 <code>params["q"]</code> may itself be an AcceptValue object, with its own 401 <code>params</code> dict. Don't ask us why; ask the authors of the HTTP spec.</para> 381 402 </section> 382 403 <section> … … 387 408 header "Range: bytes=3-6", if applied against a Python string, is requesting 388 409 resource[3:7]. This function will return the list [(3, 7)].</para> 410 </section> 411 <section> 412 <title>HeaderMap</title> 413 <para>A subclass of Python's builtin <code>dict</code> class; CherryPy's default 414 <code>request.headerMap</code> and <code>response.headerMap</code> objects are 415 instances of this class. The keys are automatically titled 416 (<code>str(key).title()</code>) in order to provide case-insensitive comparisons and 417 avoid duplicates.</para> 418 </section> 419 <section> 420 <title>parseRequestLine(requestLine)</title> 421 <para>Returns (<code>method, path, querystring, protocol</code>) from an HTTP 422 requestLine. The default Request processor calls this function.</para> 423 </section> 424 <section> 425 <title>parseQueryString(queryString, keep_blank_values=True)</title> 426 <para>Returns a dict of <code>{'key': 'value'}</code> pairs from an HTTP "key=value" 427 query string. Also handles server-side image map query strings. The default Request 428 processor calls this function.</para> 429 </section> 430 <section> 431 <title>paramsFromCGIForm(form)</title> 432 <para>Returns a dict of <code>{'key': ''value'}</code> pairs from a 433 <code>cgi.FieldStorage</code> object. The default Request processor calls this 434 function.</para> 389 435 </section> 390 436 <section> … … 461 507 <title>_cpOnError</title> 462 508 <para>_cpOnError is a function for handling unanticipated exceptions, whether raised by 463 CherryPy itself, or in user applications. The default simply raises 464 HTTPError(500).</para> 509 CherryPy itself, or in user applications. The default simply responds as if 510 HTTPError(500) had been raised.</para> 511 </section> 512 <section> 513 <title>_cpOnHTTPError</title> 514 <para>_cpOnHTTPError handles HTTPError responses, setting cherrypy.response.status, 515 headers, and body.</para> 465 516 </section> 466 517 <section> … … 470 521 class.</para> 471 522 </section> 523 <section> 524 <title>_cpLogAccess</title> 525 <para>Function to log HTTP requests into the access.log file.</para> 526 </section> 527 <section> 528 <title>_cpLogMessage</title> 529 <para>Function to log errors into the error.log file. The <code>cherrypy.log</code> 530 function is syntactic sugar for this one.</para> 531 </section> 472 532 </section> 473 533 <section id="filters">

