cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: How to POST a big amount of data?

From: Fluteau Jerome ICM N PG U PLM A 2 <jerome.fluteau_at_siemens.com>
Date: Tue, 19 Nov 2002 15:04:35 +0100

Thanks for the quick response.

It seems that I don't have the choice, the GET method only is supported by
the server.

Here is the message that I get with CURLOPT_HEADER when using POST:
HTTP/1.1 100 Continue Server: Microsoft-IIS/4.0 Date: Tue, 19 Nov 2002
12:11:16 GMT HTTP/1.1 405 Method not allowed Server: Microsoft-IIS/4.0 Date:
Tue, 19 Nov 2002 12:11:16 GMT Connection: close Allow: OPTIONS, TRACE, GET,
HEAD Content-Length: 545 Content-Type: text/html

Here is the message that I get with CURLOPT_HEADER when using GET (with a
big amount of data):

HTTP/1.1 500 Server Error Server: Microsoft-IIS/4.0 Date: Tue, 19 Nov 2002
10:38:21 GMT Content-Type: text/html Content-Length: 111 The data area
passed to a system call is too small.

Even in Internet Explorer address bar, I can not put the full URL. Annoying,
I can't even test my request this way!

Everything was working too well!!!

So to sum up:
- I can only use the GET method (I have personally no problems with
that...).
- Too much data, the Microsoft-IIS/4.0 server doesn't allow a such amount.
- Anyway when we submit the form using the WEB site, it works perfectly!

Thus when we submit the form using the WEB site, we are making a GET, and it
doesn't seem to be a problem for him,
since my form with all the new data are saved! The best way would be to know
exactly what the javascript do,
or better, to know the request when using the web site, but it is not
possible because of the SSL encryption.

So my only hope is in this question:
Is it possible to post a big amount of data using several GET requests (I
don't think so but who knows)?

Regards,

Jerome.

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Monday, November 18, 2002 8:04 PM
To: curl and php list
Subject: Re: How to POST a big amount of data?

On Mon, 18 Nov 2002, Fluteau Jerome ICM N PG U PLM A 2 wrote:

> I succedeed in posting data with the method GET with the following code:

[snip]

> But for another formular, I would need to post a lot of data and it was
not
> possible with this method (I get an error telling me that the url that I
> send is too big...) So CURLOPT_POST seemed to be a good way to do this job
> properly.

If the receiver wants a GET, you can't just do a POST at will. The receiving
end may not accept it.

> As you saw I need to make several request to reach the final form where I
> have to post my data. The problem is that when I use CURLOPT_POSTFIELDS,
> it seems that all my request have to use the POST method

Yes that's what POSTFIELDS means.

> and some of my pages don't like it: "HTTP method POST is not supported by
> this URL"

Right. You can't just use POST because you want to, the receiving site needs
to be made to accept it as well.

> So I have to mix the two methods but I don't know if Curl allows that???

You can't mix them, you either use GET or POST. That's a protocol thing, not
a curl limitation.

> So my questions are: - Is it possible to send a big amount of data with
the
> GET method (it would be great because it already works for few data)!!!

curl sets *no* limitation here. You can fire away any-size-URL using curl,
but chances are that the receiving end is not accepting "extreme" sizes.

> - If not is it possible to mix POST and GET method?

No, you can't do that. But you can pass arguments in the URL string even
when
you're doing a POST.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
Received on 2002-11-19