Hi,
I am newbie to curlpp and trying to port an existing code from libcurl
to curlpp (basically c++ porting). I went through the examples and got
some idea how I should do this porting but did not find any sample
related to XML. Here is the code snippet that I am trying to port;
_handle = curl_easy_init();
curl_easy_setopt(_handle, CURLOPT_FAILONERROR, TRUE);
_errBuf = new char[ERROR_BUF_SIZE];
curl_easy_setopt(_handle, CURLOPT_ERRORBUFFER,_errBuf);
curl_easy_setopt(_handle, CURLOPT_HEADER, TRUE);
curl_easy_setopt(_handle,CURLOPT_URL, _uri);
curl_easy_setopt(_handle,CURLOPT_INTERFACE, _ownIpAddr);
curl_easy_setopt(_handle, CURLOPT_WRITEFUNCTION,
WriteMemoryCallback);
curl_easy_setopt(_handle, CURLOPT_FILE,(void *)&memStruct);
curl_easy_setopt(_handle, CURLOPT_HEADERFUNCTION,
WriteMemoryCallback);
curl_easy_setopt(_handle, CURLOPT_WRITEHEADER,(void *)&httpHeader);
_headerList = curl_slist_append(_headerList, "Content-Type:
text/xml");
_headerList = curl_slist_append(_headerList, "Connection: close");
curl_easy_setopt(_handle, CURLOPT_HTTPHEADER, _headerList);
curl_easy_setopt(_handle, CURLOPT_POSTFIELDSIZE, _requestLen);
curl_easy_setopt(_handle,CURLOPT_POSTFIELDS, _request);
CURLcode retVal;
retVal = curl_easy_perform(_handle);
char httpVersion;
getHttpResponseInfo(httpHeader.memory, httpVersion, _responseCode);
int bytes = memStruct.size;
strncpy(_respMsg, memStruct.memory, bytes);
respMsg[bytes] = '\0';
curl_slist_free_all(_headerList);
curl_free(httpHeader.memory);
curl_free(memStruct.memory);
Could some one point me an example for xml support that will be help me
to port my code.
Appreciate your help.
Thanks,
Senthil.
_______________________________________________
cURLpp mailing list
[email protected]
http://www.rrette.com/mailman/listinfo/curlpp