kennethreitz/requests — Issue #223: Content-Length is incorrect + camel case is breaking things
Author: foxx
Created: 2011-10-24 16:21:43+00:00
State: open

Please see the following example

```

_data = """callCount=1
page=/internetsales/iSnapVehicle.xhtml?_gk=_c083894BB-4392-5290-8580-DE159D03B2B0_k9C5EF4F0-0269-3CC9-0994-633224433265

httpSessionId=
scriptSessionId=DD51AC690A8BC3BEDB1AEDF1B2A7A9DD575
c0-scriptName=PresentationRulesFacade
c0-methodName=execute
c0-id=0
c0-param0=string:VehicleForm c0-param1=string:VehicleForm%3Amake
c0-param2=string:%7B%22VehicleForm%3AdaysDriven%22%20%3A%20%221%22%2C%20%22VehicleForm%3AmilesDriven%22%20%3A%20%220%22%2C%20%22VehicleForm%3Ayear%22%20%3A%20%221998%22%2C%20%22VehicleForm%3AestimatedMileage%22%20%3A%20%22%22%2C%20%22VehicleForm%3AodometerReading%22%20%3A%20%22%22%2C%20%22VehicleForm%3Amake%22%20%3A%20%22AUDI%22%2C%20%22VehicleForm%3Ayear-txt%22%20%3A%20%22%22%2C%20%22VehicleForm%3Amake-txt%22%20%3A%20%22%22%2C%20%22VehicleForm%3Amodel-txt%22%20%3A%20%22%22%2C%20%22VehicleForm%3AmodelDesc%22%20%3A%20%22Other%22%2C%20%22VehicleForm%3Amodel%22%20%3A%20%22Other%22%2C%20%22VehicleForm%3Abodystyle%22%20%3A%20%22VAN%22%7D
c0-param3=boolean:false
batchId=327
"""

print len(_data)
_headers = {
'referer' : 'https://sales2.geico.com/internetsales/iSnapVehicle.xhtml?_gk=_c083894BB-4392-5290-8580-DE159D03B2B0_k9C5EF4F0-0269-3CC9-0994-633224433265'
}
r = requests.post(
url = 'https://sales2.geico.com/internetsales/dwr/call/plaincall/PresentationRulesFacade.execute.dwr',
data = _data,
headers = _headers
)
```

In this example, the 'Content-Length' being sent across is completely incorrect (211 bytes) and the headers themselves are sent across in an incorrect camel case, which breaks many web applications (see similar post about this here: http://bugs.python.org/issue12455 ).

Haven't got any spare time to try and patch the bug - as this was only a quick test to explore new libs.

Cal