Jump to content

CURL API Call Error - 405 HTTP verb


paulcho

Recommended Posts

Greetings,

 

I am testing cURL functionality on our new web development server to upgrade WHMCS v4 to v5.

 

------------------------------------------------

WHMCS V5 integration API call Code:

------------------------------------------------

$url = WHMCS_HREF.'includes/api.php'; # URL to WHMCS API file

$username = WHMCS_API_USERNAME; # Admin username goes here

$password = WHMCS_API_PASSWORD; # Admin password goes here

$postfields['action'] = 'addclient';

[.......other params......]

$postfields["username"] = $username;

$postfields["password"] = md5($password);

 

foreach ($params as $key=>$val)

{

$postfields[$key] = $val;

}

 

# prepare the curl

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_TIMEOUT, 100);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

$data = curl_exec($ch);

curl_close($ch);

-----------------------------------------------

 

However, I have got the follow error message:

 

405 - HTTP verb used to access this page is not allowed.

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

 

Error 139 (net::ERR_TEMPORARILY_THROTTLED): Requests to the server have been temporarily throttled.

 

------------------------------------------------

In case I enter the url in IE, whmcs api.php work.

But the above client module got the error message.

 

I have cURL enabled - UBUNTU 10.04.4, PHP 5.3.6-13, Apache 2.2.20

 

Please help me to solve the issue.

Especially, regarding apache configuration file(ubuntu virtual host conf file), php.ini, .htaccess setting/configuration.

 

Many thanks

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated