Re: Noob question about POST

[email protected]
Newsgroups gmane.comp.python.twisted.web
Message-ID <20120103151522.2755.2028764181.divmod.xquotient.29@localhost6.localdomain6>
On 31 Dec 2011, 07:22 pm, [email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.