curl-library
Re: Waiting for server response using HTTP POST approach
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 20 Feb 2008 12:53:59 +0100 (CET)
Date: Wed, 20 Feb 2008 12:53:59 +0100 (CET)
On Tue, 19 Feb 2008, Igor Bak wrote:
> There is an example for ftp resume file upload. I need smg like this
> functionality but for http post approach. I.e. I want to send at first only
> the specified header and after this depends on response transmit my file
> from specified position.
> Does somebody have an idea for this technique?
Sure! Assuming you use 7.18.0, here's one way to proceed:
1- use a read callback to provide the data for the POST
2- pause the upload on the first call to the callback unless you have received
the header you need
3- once you get your needed header, unpause the upload and proceed to provide
libcurl with the data you think should be sent off
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2008-02-20