I am using following code to adding product into magento via restapi but it's taking 10-20 second to add one product....
function saveProduct($data) {
$this->productData=json_encode($data);
try{
$oauthClient=new OAuth($this->consumerKey, $this->consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $this->authType);
$oauthClient->disableSSLChecks();
$oauthClient->enableDebug();
$oauthClient->setToken($this->token, $this->secret);
$oauthClient->fetch($this->resourceUrl, $this->productData, $this->oauthMethod, $this->headerType);
$this->responceInfo=$oauthClient->getLastResponseInfo();
$this->responce=$oauthClient->getLastResponse();
if(preg_match(PROD_ID_EXT_PTN,$this->responceInfo['headers_recv'],$m))
$this->productID=$m[1];
}
catch(OAuthException$e) {
$this->oauthError=$e;
}
}
my custom code file RestApi.php