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

  • Home
  • SEARCH
  • 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 6179045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:34:43+00:00 2026-05-24T00:34:43+00:00

I am trying to use Curl to communicate with the API of a server:

  • 0

I am trying to use Curl to communicate with the API of a server:

  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, 'pilot-payflowpro.paypal.com');
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  curl_setopt($ch, CURLOPT_HEADER, 1); // tells curl to include headers in response
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
  curl_setopt($ch, CURLOPT_TIMEOUT, 45); // times out after 45 secs
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // this line makes it work under https
  curl_setopt($ch, CURLOPT_POSTFIELDS, $plist); //adding POST data
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2); //verifies ssl certificate
  curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE); //forces closure of connection when done 
  curl_setopt($ch, CURLOPT_POST, 1); //data sent as POST 

  $result = curl_exec($ch);
  $headers = curl_getinfo($ch);
  print_r($headers);

However, the $result variable is empty, which as returntransfer was set to 1, means that no response was given. Printing out the headers gives:

( [url] => HTTP://pilot-payflowpro.paypal.com [content_type] => [http_code] => 0 
[header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 
[redirect_count] => 0 [total_time] => 1.656 [namelookup_time] => 0.062 [connect_time] => 0
 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 
[speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 
[starttransfer_time] => 0 [redirect_time] => 0 [certinfo] => Array ( ) ) 

What does this suggest in terms of debugging? I am using wamp on my local desktop with curl enabled.

Thanks.

  • 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-24T00:34:44+00:00Added an answer on May 24, 2026 at 12:34 am

    Seems like you CURLOPT_URL param is wrong… try it with a fully filled url (http://pilot-payflowpro.paypal.com)

    In your example, curl doesn’t know which protocol to use (http, https)

    Edit : Try it with https://pilot-payflowpro.paypal.com since the server you mention doesn’t respond on the http protocol

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

Sidebar

Related Questions

I'm trying to communicate with a third party server using curl. The authentication system
I'm trying to use the PHP Curl library to connect to Experian's API. When
I'm trying to use command line curl to test an API. The call takes
I'm trying to use cURL to transfer files to an ftp server, but for
I am trying to use PHP and cURL to log in to a website
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to use curl in order to follow this google redirection, but i
I am trying to use cURL to automate a login with multiple steps involved.
I am trying to use the Phaxio API to include the ability to send

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.