curl-library
Re: (no subject)
Date: Wed, 19 Jun 2002 13:39:32 +0200 (MET DST)
On Wed, 19 Jun 2002, SHIRETU wrote:
> <FORM ACTION="client" METHOD="POST" ENCTYPE="multipart/form-data">
This is a multipart formpost. You're not using libcurl's formposting
capabilities. Is that on purpose? (It is completely possibly to make your
own, just a little harder.)
> Here is the working HTTP POST from FILE*:
Hey?! *This* code uses the formpost capabilities. The obsolete function
curl_formparse() is still present and should still work (although
curl_formadd() is what you should be using.)
> I wish to replace the data source.
> I want to make the POST from a buffer with call_back function.
> It would realy help me because in call_back I want to make another
> processing task with the data to be POSTed.
Isn't curl_formadd() providing you with what you need?
> Is cURL working from VC++ with MFC?
Why wouldn't it be? libcurl doesn't stop working just because you link it
with something else...
> I've tryed the cURL 7.9.8, which I've compiled, and I can't get it
> linked in my app. Here are some errors:
> nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
> ___argv
> nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol
> ___argc
None of this is curl's business. These are all libs, objects and symbols
introduced by something else than libcurl.
> BOOL CHttp::Post(CString URL, CString data)
> {
[snip]
> res=res||curl_easy_setopt(curl, CURLOPT_URL, URL.GetBuffer(URL.GetLength()));
> res=res||curl_easy_setopt(curl, CURLOPT_POST,1);
> res=res||curl_easy_setopt(curl, CURLOPT_POSTFIELDS,"a_name=1234567890123");
This is not a multipart formpost.
> res=res||curl_easy_setopt(curl, CURLOPT_FILE, response);
> res=res||curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
You already provided the data to POST using the CURLOPT_POSTFIELDS. The read
callback won't be used then.
Also, this is obviosuly C++ code, make sure that you provide the callback as
a plain C function pointer.
> res=res||curl_easy_setopt(curl, CURLOPT_INFILESIZE, data.GetLength());
This is not used when doing POSTs.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/ ---------------------------------------------------------------------------- Bringing you mounds of caffeinated joy >>> http://thinkgeek.com/sf <<<Received on 2002-06-19