L
L
Limons2021-12-07 22:24:50
C++ / C#
Limons, 2021-12-07 22:24:50

How to send base64+ c++ post request parameters using curlcpp?

How to send base64 post request?
If you just send
string.c_str ()
then everything will not work exactly.

Yes
- const string BASE_64 = "what without code";
- Library curpcpp

Here is the code, what needs to be fixed?
Help me please!

CURL* curl;
  CURLcode res;

  curl_global_init(CURL_GLOBAL_ALL);

  curl = curl_easy_init();

  if (curl) {

    curl_easy_setopt(curl, CURLOPT_URL, URL_in.c_str());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, DATA_POST.c_str());
    res = curl_easy_perform(curl);	

    if (res != CURLE_OK) {
      fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
    }

    curl_easy_cleanup(curl);

  


  }

  curl_global_cleanup();



AND ANOTHER QUESTION HOW TO SEND ANOTHER ADDITIONAL. PARAMETERS TOGETHER WITH base64

Thank you very much)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question