[Patches] [ python-Patches-1025790 ] Add status code constants to httplib

SourceForge.net noreply at sourceforge.net
Mon Sep 13 07:54:49 CEST 2004


Patches item #1025790, was opened at 2004-09-10 13:48
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1025790&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Eland (andreweland)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add status code constants to httplib

Initial Comment:
httplib doesn't define constants for the HTTP integer
status codes, so most applications end up defining
their own subset. This patch adds status code constants
to httplib, using the same names as Twisted, and
updates the documentation.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2004-09-13 07:54

Message:
Logged In: YES 
user_id=21627

207 comes from RFC 2518 (WebDAV), section 8.2.1 and 10.2.
507 likewise, section 10.6. It seems WebDAV codes that 102,
422, 423, 424 are missing. Likewise, 426 from RFC 2817 is
missing, and 226 from RFC 3229.
510 comes from RFC 2774 (HTTP Extensions), section 7.

Even though I agree with your procedure for creating
"canonical" spellings, I think more documentation is needed.
Following this procedure, it would be best to list RFC and
section as the documentation; this might allow to leave out
the numerical value IMO. OTOH, putting this all in a
four-column table (constant name, value, RFC number,
section) would make a very systematic presentation.


----------------------------------------------------------------------

Comment By: Andrew Durdin (adurdin)
Date: 2004-09-13 03:51

Message:
Logged In: YES 
user_id=625864

I think the best standard way of spelling the constants is
to take them directly from the 10.x.x headings of RFC2616.
This would require changing four of the names of the
constants in the patch from:
  SWITCHING = 101
  MULTIPLE_CHOICE = 300
  NOT_ALLOWED = 405
  PROXY_AUTH_REQUIRED = 407
to:
  SWITCHING_PROTOCOLS = 101
  MULTIPLE_CHOICES = 300
  METHOD_NOT_ALLOWED = 405
  PROXY_AUTHENTICATION_REQUIRED = 407

Also, the following status codes are not part of the
HTTP/1.1 standard as given in RFC2616:
  MULTI_STATUS = 207
  INSUFFICIENT_STORAGE_SPACE = 507
  NOT_EXTENDED = 510

Where do these come from? Being nonstandard, is it
inappropriate to include them in httplib?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2004-09-10 22:54

Message:
Logged In: YES 
user_id=21627

Unless the precise spelling of the constants is taken from
some existing specification, I think the documentation needs
to spell out the values, so that readers can easily confirm
that a certain symbolic value has the meaning they expect.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1025790&group_id=5470


More information about the Patches mailing list