This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BitTorment
Recipients BitTorment, zathras
Date 2008-05-05.09:45:06
SpamBayes Score 0.18750031
Marked as misclassified No
Message-id <1209980709.72.0.185479087894.issue2756@psf.upfronthosting.co.za>
In-reply-to
Content
I can see that there will be a problem in this case.

However, it may be that the authors found it more intuitive to always
set the Content-Type to application/x-www-form-urlencoded when data is set.

Their implementation is inconsistent though:

#-------------------------------------------------------
request = urllib2.Request('http://www.somesite.com/')
request.add_data(data)
f = urllib2.urlopen(request)

# 'Content-Type: application/x-www-form-urlencoded' is sent in the header
#-------------------------------------------------------

whereas:

#-------------------------------------------------------
request = urllib2.Request('http://www.somesite.com/')
request.add_header('Content-Type', 'application/xml')
request.add_data(data)

# 'Content-Type: application/xml' is sent in the header
#-------------------------------------------------------

We need to decide what is the best way to handle this case.  Should the
normal headers be given preference, or should the unredirected headers
be given preference?

--- Martin
History
Date User Action Args
2008-05-05 09:45:12BitTormentsetspambayes_score: 0.1875 -> 0.18750031
recipients: + BitTorment, zathras
2008-05-05 09:45:11BitTormentsetspambayes_score: 0.1875 -> 0.1875
messageid: <1209980709.72.0.185479087894.issue2756@psf.upfronthosting.co.za>
2008-05-05 09:45:08BitTormentlinkissue2756 messages
2008-05-05 09:45:07BitTormentcreate