curl-library
CURLOPT_POSTFIELDS data, causes all following calls to attempt a post even when it should be a get
Date: Mon, 29 Apr 2002 14:41:14 -0400
The following is the output of my code, it consists of 2 command one submits
a form the other reads any image, the first works fine, however when the
second call is made using the same handle the form data from the first is
still sent through, as a result the second fails, if I destroy the handle
and recreate it then everything is fine, however I would prefer not to have
to do so. Is there any method which would allow me reset the data that was
set by CURLOPT_POSTFIELDS, so that the handle would not need to be
reconstructed, but would have the same effect. Note that the second request
went from a get to a post because of the data left over from
CURLOPT_POSTFIELDS, I had thought about just clearing the old data out with
something like:
data->set.httpreq = HTTPREQ_GET;
data->set.postfields = NULL;
in url.c, and creating a new CURLOPT_POSTFIELDS_CLEAN options that would
call this, but this did not fix the problem, is there an existing method,
or else a better way to submit a form, which is only valid for the next
transaction to the server and is then cleared? Please note that the program
that I'm writing is in perl, but as the perl curl module, is a direct pass
through to C I can not see that it could make any difference?
****************************************************************************
********************
MY debugging output, showing that the submitted data is used the second
request.
I have replaced the IP and login with <IP>, <WITHHELD>
****************************************************************************
********************
Processing a statement of type web_submit_data
form_fields for submition is: 'loginName=
&loginPassword=test3746&verify=yes&actionID=1&verification.x=32&verification
.y=18'
url is: http://<IP>/ecenterdemo/default.asp
* Re-using existing connection! (#2)
* Connected to <IP> (<IP>) port 80
> POST /ecenterdemo/default.asp HTTP/1.1
Host: <IP>
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Cookie: ASPSESSIONIDGQGGQQMC=BOLHBPHAOOPILPPPNNDKBKFN
Content-Length: 106
Content-Type: application/x-www-form-urlencoded
loginName=
<withheld>&loginPassword=test3746&verify=yes&actionID=1&verification.x=32&ve
rification.y=18* Connection #2 left intact
contenttype found is 'text/html'
contenttype to find is 'text/html'
httpcode is 200
Header is
HTTP/1.1 100 Continue
Server: Microsoft-IIS/4.0
Date: Mon, 29 Apr 2002 18:26:10 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/4.0
Date: Mon, 29 Apr 2002 18:26:11 GMT
Content-Type: text/html
Cache-control: private
Transfer-Encoding: chunked
Document is
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<body onLoad="startApplication();">
<SCRIPT LANGUAGE="JavaScript"
SRC='./Includes/ScriptLibrary/launchNewWindow.js'></SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
function launchECenterOne(frameset) {
launchNewWindow(frameset,true,true,false,false,false,true,800,550,'ECenterOn
eMain',false);
}
function startApplication() {
launchECenterOne('./application/TopNavFrameset.asp');
}
//-->
</script>
<p style="BACKGROUND-COLOR: white" align="center"><img
height="130" src="images/logo.GIF" style="HEIGHT: 130px; WIDTH: 297px"
width="297"></p>
<P ALIGN="CENTER"> </P>
<P ALIGN="CENTER">E-Center One has been started in a new
browser. You may close this window.</P>
</body>
looking for a param from the list of registered params
found 0 replacement params was looking for 0 objects
Processing a statement of type web_url
url is: http://<IP>/ecenterdemo/Includes/ScriptLibrary/launchNewWindow.js
* Re-using existing connection! (#2)
* Connected to <IP> (<IP>) port 80
> POST /ecenterdemo/Includes/ScriptLibrary/launchNewWindow.js HTTP/1.1
Host: <IP>
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Cookie: ASPSESSIONIDGQGGQQMC=BOLHBPHAOOPILPPPNNDKBKFN
Content-Length: 106
Content-Type: application/x-www-form-urlencoded
loginName=<withheld>&loginPassword=test3746&verify=yes&actionID=1&verificati
on.x=32&verification.y=18* Closing connection #2
contenttype found is 'text/html'
contenttype to find is 'application/x-javascript'
httpcode is 405
Header is
HTTP/1.1 100 Continue
Server: Microsoft-IIS/4.0
Date: Mon, 29 Apr 2002 18:26:11 GMT
HTTP/1.1 405 Method not allowed
Server: Microsoft-IIS/4.0
Date: Mon, 29 Apr 2002 18:26:11 GMT
Connection: close
Allow: OPTIONS, TRACE, GET, HEAD
Content-Length: 545
Content-Type: text/html
Document is
<html><head><title>Error 405</title>
<meta name="robots" content="noindex">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1"></head>
<body>
<h2>HTTP Error 405</h2>
<p><strong>405 Method Not Allowed</strong></p>
<p>The method specified in the Request Line is not allowed for the resource
identified by the request. Please ensure that you have the proper MIME type
set up for the resource you are requesting.</p>
<p>Please contact the server's administrator if this problem persists.</p>
</body></html>
Eric Gandt
Senior Engineer
Received on 2002-04-30