[Twisted-web] Noob question about POST

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jan 3 10:15:22 EST 2012


On 31 Dec 2011, 07:22 pm, steiny at steiny.com wrote:
>Hi,
>
>[snip]
>
>If I telnet to localhost port 80 and copy and paste the following:
>
>=== BEGINNING OF WORKING INPUT TO SERVER  ===
>POST /locked/checklogin.php HTTP/1.1
>Host: www.mysite.com
>User-Agent: Mozilla/4.0
>Content-Length: 31
>Content-Type: application/x-www-form-urlencoded

I notice that in this POST, your content type is "application/x-www- 
form-urlencoded".
>
>
>myusername=john&mypassword=1234
>===== END OF WORKING INPUT TO SERVER ====
>
>[snip]
>
>==== START OF CODE MODIFIED WITH POST ===
>
>[snip]
>
>d = agent.request(
>     'POST',
>     'http://localhost/locked/checklogin.php',
>     Headers({'User-Agent': ['Mozilla 5.0'],
>         'Content-Type': ['multipart/form-data; charset=utf-8']}),
>     body)

However, with this one, you've switched to "multipart/form-data".

Perhaps this difference is the cause of the problem?

Jean-Paul



More information about the Twisted-web mailing list