cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Strange behavior of CURLOPT_POSTFIELDS

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 17 Dec 2012 22:11:50 +0100 (CET)

On Mon, 17 Dec 2012, Jeff Pohlmeyer wrote:

>> if I have a const char* string literal in CURLOPT_POSTFIELDS it works. If
>> it's not coming from a literal, it fails.
>
> Are you using a local variable to store the paramsString? I think that won't
> work, the string must remain in scope until curl_easy_perform() returns.

... at least if a version earlier than 7.17.0 is used. After that version
libcurl copies provided strings.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-17