curl-users
How to make right response(302 Found)?
Date: Thu, 28 Feb 2008 23:11:21 +0800
Hi,
I use curl.exe to post.
It was posted by Internet Explorer like follows:
------------------------------------------------------------------------
POST /article/addSubmit HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer: http://adm.blog.roodo.com/article/add
Accept-Language: zh-tw
Content-Type: multipart/form-data;
boundary=---------------------------7d81fc2cf032c
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: adm.blog.roodo.com
Content-Length: 2600
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: __utma=7915745.72454028.1202643842.1202643842.1202711065.2;
__utmb=7915745;
__utmz=7915745.1202643842.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);
__utmc=7915745;
__utma=7915745.72454028.1202643842.1202643842.1202711065.2;
__utmb=182283895.1;
__utmz=182283895.1202711161.1.2.utmcsr=members.roodo.com|utmccn=(referral)|utmcmd=referral|utmcct=%2Flogin%2Fblog;
__utmc=182283895.1; ROODOSESSION=00a784f77c361a24484130ac440b5e80;
bkey=TlRBNE5UWTNMR0Z6YVdGbVpXbDVhVzVuTEdabGJtZHphR1Z1ZEhWcFFIaDFhWFJsTG01bGRBPT0%3D;
key=ZmVuZ3NoZW50dWlAeHVpdGUubmV0LDM1MTEyMSwg;
u1=NTA4NTY3LGFzaWFmZWl5aW5nLGFzaWFmZWl5aW5nLCAsICwgLCA%3D; u2=IA%3D%3D;
PHPSESSID=00a784f77c361a24484130ac440b5e80;
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="asID"
931665
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="reload"
0
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="bID"
278539
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="title"
?????????
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="pCID"
0
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="bCID"
9
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="gCID"
0
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="content"
best of Jim
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="file"; filename=""
Content-Type: application/octet-stream
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="appendix"
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="excerpt"
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="aStatus"
public
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="articleTop"
no
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="autoNewLine"
yes
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="allowComment"
yes
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="allowTrackback"
yes
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="pingURL"
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="created"
2008-02-11 14:22:54
-----------------------------7d81fc2cf032c
Content-Disposition: form-data; name="save"
???Blog
-----------------------------7d81fc2cf032c--
------------------------------------------------------------------------
And the response is *302 Found.
*HTTP/1.1 302 Found
Content-Length: 0
Date: Mon, 11 Feb 2008 06:29:09 GMT
Connection: Keep-Alive
Location: http://adm.blog.roodo.com/article/list&blog_ping=yes
Server: Apache
X-Response-Time: 0.205964 seconds
X-Powered-By: PHP/5.2.5-pl1-gentoo
Content-Type: text/html; charset=utf-8
Keep-Alive: timeout=5, max=2048*
*But I use curl to post like follows:
------------------------------------------------------------------------
POST /article/addSubmit HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: adm.blog.roodo.com
Accept: */*
Referer: http://adm.blog.roodo.com/article/add
Cookie: PHPSESSID=62d48c1663d15f9735ab349e15906ceb; u2=IA%3D%3D;
u1=NTA4NTY3LGFzaWFmZWl5aW5nLGFzaWFmZWl5aW5nLCAsICwgLCA%3D;
key=ZmVuZ3NoZW50dWlAeHVpdGUubmV0LDM1MTEyMSwg;
bkey=TlRBNE5UWTNMR0Z6YVdGbVpXbDVhVzVuTEdabGJtZHphR1Z1ZEhWcFFIaDFhWFJsTG01bGRBPT0%3D;
ROODOSESSION=62d48c1663d15f9735ab349e15906ceb
Content-Length: 2571
Content-Type: multipart/form-data;
boundary=----------------------------7bb233f6b053
------------------------------7bb233f6b053
Content-Disposition: form-data; name="asID"
------------------------------7bb233f6b053
Content-Disposition: form-data; name="reload"
0
------------------------------7bb233f6b053
Content-Disposition: form-data; name="bID"
278539
------------------------------7bb233f6b053
Content-Disposition: form-data; name="title"
??????????
------------------------------7bb233f6b053
Content-Disposition: form-data; name="pCID"
0
------------------------------7bb233f6b053
Content-Disposition: form-data; name="bCID"
9
------------------------------7bb233f6b053
Content-Disposition: form-data; name="gCID"
0
------------------------------7bb233f6b053
Content-Disposition: form-data; name="content"
Great trick to calculate fast!Try it! ;)
------------------------------7bb233f6b053
Content-Disposition: form-data; name="file"
------------------------------7bb233f6b053
Content-Disposition: form-data; name="appendix"
------------------------------7bb233f6b053
Content-Disposition: form-data; name="excerpt"
------------------------------7bb233f6b053
Content-Disposition: form-data; name="aStatus"
public
------------------------------7bb233f6b053
Content-Disposition: form-data; name="articleTop"
no
------------------------------7bb233f6b053
Content-Disposition: form-data; name="autoNewLine"
yes
------------------------------7bb233f6b053
Content-Disposition: form-data; name="allowComment"
yes
------------------------------7bb233f6b053
Content-Disposition: form-data; name="allowTrackback"
yes
------------------------------7bb233f6b053
Content-Disposition: form-data; name="pingURL"
------------------------------7bb233f6b053
Content-Disposition: form-data; name="created"
2008-02-11 14:36:07
------------------------------7bb233f6b053
Content-Disposition: form-data; name="save"
???Blog
------------------------------7bb233f6b053--
------------------------------------------------------------------------
But the response is *200 OK. *The post do not works.
*
HTTP/1.1 200 OK
Content-Length: 0
Date: Mon, 11 Feb 2008 06:36:32 GMT
Server: Apache
X-Response-Time: 0.217382 seconds
X-Powered-By: PHP/5.2.4_pre200708051230-pl2-gentoo
Content-Type: text/html; charset=utf-8
**
*Can anyone assist to give me the right way to get right response 302
Found?*
*Thanks very much.
Jian
Received on 2008-02-28