cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: {NEED HELP] POST data redirected with 302

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 19 Aug 2005 11:55:54 -0500

Just a wild guess here, but if both curl *and* a web browser are being
redirected to flotten1.php, it's because that's where the server wants you
to go. You'd have to get to the server's code to find out why.

Assuming that's impossible, the next best thing would be to load up the
LiveHTTPHeaders extension in Firefox and track what actually happens when
you post the form. Watch the entire transaction and see if there're any
steps you're missing in your script. Also, examine any output returned by
the web server and look for javascript or meta-refresh tags that send your
browser someplace else. Your statement "after 5 seconds I'm redirected"
suggests there's a timer in there somewhere. If so, curl won't care - it's
not designed to...

Ralph Mitchell

On 8/19/05, tommmmmm_at_gmail.com <tommmmmm_at_gmail.com> wrote:
>
> Hi,
>
> I know it's kind of rude to ask a question just like that, but I asked in
> many
> places, and no one could help.
>
> I decided to ask question (a favour) here, because on
> -jabber channels
> -linuxquestions
> -wget help page
> -google
> None could help me. To get you a better view of what my bug/problem is
> I'm giving you the output of ab command:
>
> --------------------------------------------------------------------------------------------------------------
> Benchmarking ogame256.de <http://ogame256.de> (be patient)...INFO: POST
> header ==
> ---
> POST /game/flottenversand.php?session=2fb5361c7fb1 HTTP/1.0
> User-Agent: ApacheBench/1.3d
> Host: ogame256.de <http://ogame256.de>
> Accept: */*
> Content-length: 194
> Content-type: text/plain
>
>
> ---
> LOG: header received:
> HTTP/1.1 302 Found
> Date: Fri, 19 Aug 2005 15:27:38 GMT
> Server: Apache/2.0.54 (Unix) PHP/4.4.0
> X-Powered-By: PHP/4.4.0
> Set-Cookie: PHPSESSID=e02d06944da4bf891c0cf0e624601f34; path=/
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Location: /game/flotten1.php?session=2fb5361c7fb1
> Vary: Accept-Encoding
> Content-Length: 0
> Connection: close
> Content-Type: text/html
>
>
> WARNING: Response code not 2xx (302)
> ..done
> Server Software: Apache/2.0.54
> Server Hostname: ogame256.de <http://ogame256.de>
> Server Port: 80
>
> Document Path: /game/flottenversand.php?session=2fb5361c7fb1
> Document Length: 0 bytes
>
> --------------------------------------------------------------------------------------------------------------
>
> I'm trying to send POST data to flottenversand.php but i'm getting
> redirected
> and the post data is being sent (?) to flotten1.php which I do not want to
> happen.
>
> Firstly I tried wget, but obviously "Note: if Wget is redirected after the
> POST request is completed, it will not send the POST data to the
> redirected
> URL." I also tried curl. I did make all settings apropriate, but it seems
> that
> the POST data is not being sent to flottenversand.
>
> If I submit the form with webbrowser, I see the flottenversand.php ( its
> content depends on what was sent in form) and then after 5 seconds
> i'm redirected to flotten1.php
>
> I want to leech flottenversands.php content multiple times so using
> webrowser
> is not a good idea.
>
> Let me apologize one more time for being so selfish ans asking just like
> that.
>
>
> I'm counting on some help..
>
>
> tommmmmm_at_gmail.com
>
>
Received on 2005-08-19