curl-and-php
Re: How to POST a big amount of data?
Date: Mon, 18 Nov 2002 20:03:42 +0100 (MET)
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.htmlReceived on 2002-11-18