Re: How to work with Amadeus ?
Date: Tue, 8 Sep 2020 16:18:30 +0530
Pl check following
https://curl.haxx.se/libcurl/c/CURLOPT_XOAUTH2_BEARER.html on how to set
and use oAUth token.
Thanks
On Tue, Sep 8, 2020 at 3:32 PM <curl-users-request_at_cool.haxx.se> wrote:
> Send curl-users mailing list submissions to
> curl-users_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> or, via email, send a message with subject or body 'help' to
> curl-users-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-users-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-users digest..."
>
>
> Today's Topics:
>
> 1. How to work with Amadeus ? (Dan Richter)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 8 Sep 2020 11:28:55 +0200
> From: Dan Richter <richterd_at_atlas.cz>
> To: curl-users_at_cool.haxx.se
> Subject: How to work with Amadeus ?
> Message-ID: <5729c925-4e58-3068-eb94-3139367bfcb7_at_atlas.cz>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Hi,
>
> 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
>
> https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262
>
> // CurlTest.cpp
>
> #define CURL_STATICLIB
> #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, "https://tcno.co/hello.txt");
> 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);
>
> curl_easy_cleanup(curl);
>
> if (CURLE_OK != res) {
> std::cerr << "CURL error: " << res << '\n';
> }
> }
> curl_global_cleanup();
>
> std::cout << result << "\n\n";
> }
>
> Your kind advice would be highly appreciated.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-users/attachments/20200908/e39df434/attachment-0001.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> curl-users mailing list
> curl-users_at_cool.haxx.se
> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
>
>
> ------------------------------
>
> End of curl-users Digest, Vol 181, Issue 4
> ******************************************
>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-09-08