curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: debug CURLOPT_POSTFIELDS url?

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 10 Oct 2019 11:03:11 +0200 (CEST)

On Thu, 10 Oct 2019, ka sc via curl-library wrote:

> url_flags = "\"[\\\"INSERT INTO foo2 values(1,11)\\\"]\"";
> curl_easy_setopt(curl, CURLOPT_POSTFIELDS, url_flags.c_str());
>
> Is there a way to see the output url so I can try that in commandline?

The data you set with CURLOPT_POSTFIELDS is not part of the URL - it is part
of the request body - so seeing the URL won't help you.

You can see the URL with CURLOPT_VERBOSE set to 1L, but since you probably
rather see the request body so that you get to see what you post you want to
add a CURLOPT_DEBUGFUNCTION callback and show the data that way.

Possibly based on this example code: https://curl.haxx.se/libcurl/c/debug.html

Alternatively, you make a command line version of the request with curl that
works and then you convert that to libcurl code with the "--libcurl code.c"
option.

-- 
  / daniel.haxx.se | Get the best commercial curl support there is - from me
                   | Private help, bug fixes, support, ports, new features
                   | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-10-10