curl / Mailing Lists / curl-users / 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.

How to work with Amadeus ?

From: Dan Richter via curl-users <>
Date: Tue, 8 Sep 2020 11:28:55 +0200


I am a newbie to cURL on C++ (Visual Studio 2017).

Any advice how to modify the working sample code below to send
Authorization Request/Response (token) to Amadeus API and than send the
actual Amadeus command ? See

// CurlTest.cpp

#include <iostream>
#include <string>

#include "curl/curl.h"

static size_t my_write(void* buffer, size_t size, size_t nmemb, void* param)
     std::string& text = *static_cast<std::string*>(param);
     size_t totalsize = size * nmemb;
     text.append(static_cast<char*>(buffer), totalsize);
     return totalsize;

int main()
     /*std::cout << "Hello World!\n";*/
     std::string result;
     CURL* curl;
     CURLcode res;

     curl = curl_easy_init();
     if (curl) {
         curl_easy_setopt(curl, CURLOPT_URL, "");
         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write);
         curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result);

         curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

         res = curl_easy_perform(curl);


         if (CURLE_OK != res) {
             std::cerr << "CURL error: " << res << '\n';

     std::cout << result << "\n\n";

Your kind advice would be highly appreciated.

Received on 2020-09-08