Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6158159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:54:37+00:00 2026-05-23T20:54:37+00:00

I decided to implement OpenID login into my C++ server. I looked at list

  • 0

I decided to implement OpenID login into my C++ server. I looked at list of avaliable C++ OpenID clients and found only one popular libopkele. But its requirements seem quite way 2 much for my simple server which has its own xml parser, uses boost for regexps and so on.

So I want to create simple openID client in C++, so I decided to port PHPclient (because I know PHPa bit). There is class called class.openid.php which in its first version is just 200 lines of PHP code. My main problem is I never used curl before in PHP nor in c++. SO I beg for help in translating to C/C++ such PHP code:

function CURL_Request($url, $method="GET", $params = "") { // Remember, SSL MUST BE SUPPORTED
        if (is_array($params)) $params = $this->array2url($params);
        $curl = curl_init($url . ($method == "GET" && $params != "" ? "?" . $params : ""));
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_HTTPGET, ($method == "GET"));
        curl_setopt($curl, CURLOPT_POST, ($method == "POST"));
        if ($method == "POST") curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($curl);

        if (curl_errno($curl) == 0){
            $response;
        }else{
            $this->ErrorStore('OPENID_CURL', curl_error($curl));
        }
        return $response;
}

So.. How to translate such function to C++ (using libCURL) from PHP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:54:38+00:00Added an answer on May 23, 2026 at 8:54 pm

    cURL has a C API: link. You can use this from C++ too.

    It shouldn’t be difficult to rewrite the function you gave when you use the cURL API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've decided to implement a user login using a per-user salt, stored in the
I had some time and decided to implement a one time pad just for
I decided to implement a simple messaging system into my project. I'm using this
I've decided to implement a caching facade in one of our applications - the
I'm in the midst of a university project and have decided to implement a
I'm a beginner (self-learning) programmer learning C++, and recently I decided to implement a
I've decided to implement my own interface for connecting two devices running my game,
I was going through: C++ FAQs about inheritance and decided to implement it just
While working with WinAPI, I decided to implement a call to GetProcessAfinityMask in my
Possible Duplicate: Int128 in .Net? After I decided to implement my Int128 in C#,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.