Richard | 1 Apr 17:15 2006
Picon

help needed

I need to recreate the following in curl but having
trouble writing the correct functions :o(  

/cgi-bin/login.fcg

POST /cgi-bin/login.fcg HTTP/1.1
Host: 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-GB; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: /cgi-bin/playerWelcome.fcg
Cookie: sessionId=00002208672d6c28
Content-Type: application/x-www-form-urlencoded
Content-Length: 33
companyName=dfdsfsdfdsf&x=73&y=16
HTTP/1.x 302 Found
Transfer-Encoding: chunked
Date: Sun, 12 Mar 2006 16:56:53 GMT
Content-Type: text/html; charset=iso-8859-1
Server: Apache/1.3.27 (Unix) PHP/4.3.0
Location: /cgi-bin/welcome.fcg
----------------------------------------------------------
/cgi-bin/welcome.fcg

(Continue reading)

Daniel Stenberg | 1 Apr 20:15 2006
Picon

Re: help needed

On Sat, 1 Apr 2006, Richard wrote:

> I need to recreate the following in curl but having trouble writing the 
> correct functions :o(

And what did you try to far? Seem to be a "plain" case of using -d, -b, -c and 
-L.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Richard | 2 Apr 15:18 2006
Picon

Re: help needed

Hi Daniel,

The two functions I have written so far to cover this
are :

#define PROPERTYPAGE
"/cgi-bin/clickSq.fcg?rowPos=23&colPos=30"
#define ACTIONPAGE "/cgi-bin/action.fcg"

int property(){
  long httpcode;
  char data[MAXSTR];
  char formdata[MAXSTR],cookiedata[MAXSTR];

  CURLcode res;
  CURL *curl;

  #ifdef VERBOSE
  fprintf(stdout,"property\n");
  #endif //VERBOSE

  curl = curl_easy_init();
  if(!curl) {
	fprintf(stderr,"Error: %s\n","Can't Initialize
CURL");
	return -1;
  }	

  InitializeData();
  curl_easy_setopt(curl, CURLOPT_URL, SITE
(Continue reading)

xi chum | 5 Apr 16:26 2006
Picon

Curl -F didn't upload file but return the form itself

Hi All,
 
I am new to curl.  I just wanted to use curl to upload an xml file to a form but failed miserably.
 
The form requires a file upload with the name of "xmlfile".
 
Here is the command format:
 
 
The response via STDOUT is the upload.html sending back from the http server but the xmlfile was not uploaded.  And there were no error return by curl or the HTTP server.
 
Please advise as what additiona switch I should be using to find more as to what is going between curl and http server?
 
Thanks in advance.
 
Xi.
 
 
Daniel Stenberg | 5 Apr 23:27 2006
Picon

Re: Curl -F didn't upload file but return the form itself

On Thu, 6 Apr 2006, xi chum wrote:

> /usr/bin/curl -F "xmlfile= <at> 101.xml" http://localhost:8080/test/upload.html

I would say that it is highly unlikely that you send any upload to a HTML 
file. Normally you send it to some kind of script/CGI that receives it.

That HTML file most probably contains a <form> and that has an action 
attribute pointing out the correct URL you actually want for this.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Daniel Stenberg | 6 Apr 08:59 2006
Picon

Three current big things

Hi

Here's three big "things" happening right now in (lib)curl that I want to 
point users' attention to, as we will appreciate testing and feedback on these 
things. "Right now" of course means now, and within a few weeks/months ahead. 
It is a bit hard to estimate any closer.

NTLM improved

   Michele Bini has improved the NTLM code and I committed his changes to CVS
   yesterday. While this should improve our NTLM ability, the very nature of
   NTLM is somewhat secret and magic...

EBCDIC conversion for FTP

   David McCreedy works on adding support for FTP transfers on EBCDIC systems
   (and specifically IBM TPF).

curl_multi_socket

   This is a new set of functions I'm introducing in my hiper project. They're
   not yet (verified to be) fully working, but maintaining the patch for this
   outside the normal source tree is becoming quite a burdon so I'm aiming at
   committing what I have so far and we'll make sure it doesn't break anything
   existing and then I'll continue working on hiper closer to the CVS version.

The NTLM part is already in CVS and will be part of the next release. The 
EBCDIC support is about to go in and will hopefully also be part of the next 
release. The multi_socket API will not be officially support in the next 
release, but will take some more effort and time first. I've been intending to 
release a 7.16.0 version when the *multi_socket() API comes for real but it is 
not set in stone.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Dan Aldridge | 6 Apr 11:26 2006
Picon

Re: Problems with Proxy use

I am very new to the curl program,  But found its great. 
I have an issue with proxy's which i hope i can be pointed in the right direction. 

I use the following command  at  work using transparent  proxy's and the data is uploaded and  processed correctly (and it generates and sends a html file back to me.  ).

curl -F mdsData= <at> ukblx082.mup -F sendfile="Upload file" http://www.foo.com/webapp/set2/mds/mds


I then issue the same command but go via a proxy (on a customer network) to get to the same website it uploads the file and then hangs :-

curl -F mdsData= <at> ukblx082.mup -F sendfile="Upload file" http://www.foo.com/webapp/set2/mds/mds -x http://proxy.proxy.foo.net:8080 -v


I then get the following (using -v)

* About to connect() to proxy proxy.proxy.foo.net port 8080
*   Trying 999.999.999.220... connected
* Connected to proxy.proxy.foo.net (999.999.999.220) port 8080
> POST http://www.foo.com/webapp/set2/mds/mds HTTP/1.1
> User-Agent: curl/7.15.1 ( powerpc-ibm-aix5.3.0.0) libcurl/7.15.1
> Host: www.foo.com
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
> Content-Length: 16464
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------6a287b364154
>
< HTTP/1.1 100 Continue
< Via: HTTP/1.1 proxy.proxy.net.net (IBM-PROXY-WTE), 1.1 UKBLISA001


It just then hangs and does not give me anymore info.

xi chum | 6 Apr 12:47 2006
Picon

Re: Curl -F didn't upload file but return the form itself

 

 

Doh!!!

 

 

Thanks Daniel,

Xi Chum. 

From:  Daniel Stenberg <daniel <at> haxx.se>
Reply-To:  the curl tool <curl-users <at> cool.haxx.se>
To:  the curl tool <curl-users <at> cool.haxx.se>
Subject:  Re: Curl -F didn't upload file but return the form itself
Date:  Wed, 5 Apr 2006 23:27:31 +0200 (CEST)
>On Thu, 6 Apr 2006, xi chum wrote:
>
>>/usr/bin/curl -F "xmlfile= <at> 101.xml"
>>http://localhost:8080/test/upload.html
>
>I would say that it is highly unlikely that you send any upload to a
>HTML file. Normally you send it to some kind of script/CGI that
>receives it.
>
>That HTML file most probably contains a <form> and that has an
>action attribute pointing out the correct URL you actually want for
>this.
>
>--
>  Commercial curl and libcurl Technical Support:
>http://haxx.se/curl.html
Daniel Stenberg | 6 Apr 12:53 2006
Picon

Re: Problems with Proxy use

On Thu, 6 Apr 2006, Dan Aldridge wrote:

> I then get the following (using -v)

...

>> Expect: 100-continue

...

> < HTTP/1.1 100 Continue
> < Via: HTTP/1.1 proxy.proxy.net.net (IBM-PROXY-WTE), 1.1 UKBLISA001
>
> It just then hangs and does not give me anymore info.

It looks like your proxy is being stupid. It should send another response code 
following that 100 one.

Try using -H "Expect:" to see if it makes any difference if you disable that 
header.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Blurry | 7 Apr 09:17 2006
Picon

Maintaining credentials

After struggling with a site I KNEW was NTLM, I found
--negotiate to work, eventhough it is an IIS
server...anyway, once you login it does 1 or 2
redirects (I think) when you use an IE browser to take you to the
end page. Using curl it stops at the login success
page without following the redirects (yes I use -L).
If I subsequently use curl to go to that end page, I
get 'your login period has passed". So how can I get
to this end page ? What am I missing ?
Thanks


Gmane