The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [curl]

Specify questions about cURL which provide library and command-line tool for transferring data using various protocols.

Filter by
Sorted by
Tagged with
1
vote
0answers
46 views

Customer Logout using CURL request

I want to logout customer from external request based on the customer ID. For example, I have created custom controller action that accepts customer email in a GET request. I want to perform logout ...
0
votes
1answer
24 views

Magento 2 : Rest API error the requested URL returned error: 401

We have to test rest API is working or not in magento 2.3 but on my local project work only live site API not working. We have to check site open or not using curl but it's not working. I am not able ...
1
vote
1answer
22 views

Curl OPTIONS request in Magento 2

I would like to do this request : curl -i -X OPTIONS my/url/path in Magento 2. This code works : $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => 'my/url/path', ...
0
votes
0answers
24 views

Magento 2: curl Couldn't connect to server

I am a Magento/curl neebiw and need help the he following code which returns 'Couldn't connect to server' but when I do the equivalent in a form and click submit I get the response 'Hi from Ostendo', ...
0
votes
0answers
23 views

Magento 2 Curl : is setting Content-Type: application/x-www-form-urlencoded despite providing Content-Type: application/json

I am facing a weird issue while using Magento 2.2.6 default Curl class Magento\Framework\HTTP\Client\Curl.php to send a curl request. Magento is automatically somehow adding another Content-Type: ...
1
vote
1answer
24 views

How to write this Curl code to Magento 2 code?

I am calling third party API using below methods: public function setCredentials($data) { $curl = curl_init('https://example_url.com/'); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($...
0
votes
1answer
148 views

Upload local file to sever SFTP via curl php

I am trying to implement upload local file to server via sftp curl method but facing File upload error. Error number: 7. Here is my code. <?php $ourFileName = "/var/www/html/example.com/...
0
votes
2answers
85 views

how to use curl for external api call in magento 2

How do I make a post request with curl without using a button, but instead calling the external API when a field is filled out
0
votes
1answer
24 views

Magento 2 logout using curl

As per my requirement i want to logout the customer using PHP curl. for that I used the following code in my custom controller action(execute) $lastCustomerId = $this->_customerSession->getId()...
0
votes
0answers
108 views

Not getting the order id using payment information API in magento-2

I need to create the order id after checkout page using endpoints from Magento-2. As per my code, I am getting the following error. {"message":"Please check the shipping address information. ...
2
votes
0answers
44 views

Algolia REST Api's to apply category, Price and Brand filters using PHP curl process on Algolia?

I Have sample curl code, It is working perfectly but I don't know, how to apply filters on category, price, and brands to get all products list. we are using algolia REST API's. $APPI_ID = "...
0
votes
0answers
37 views

magento 1.9: stop newsletter spam with CURL

I have added this module in Magento 1.9 for stop spam in newsletters. https://magecomp.com/magento-google-recaptcha.html This worked fine but, when I try to sign up for the newsletter via curl it ...
0
votes
0answers
91 views

How command pool works? and How can we redirect to payment gateway? Magento 2

I'm integrating a payment gateway using gateway command pool. This is di.xml <virtualType name="AuthorizeCommand" type="Magento\Payment\Gateway\Command\GatewayCommand"> <arguments> ...
2
votes
0answers
225 views

WorldPay Payment Integration using PHP and direct XML method curl API return blank page in Magento 2

I m trying to implement worldpay on a PHP site using XML direct method but whenever I try to connect I get blank pag.. Can you tell me were you testing the payment gateway on live site. Code: $...
2
votes
1answer
412 views

Magento 2 GET API request to external api

In magento 1 you can make get request like this: First Authorizing object- public function authorize($url) { $cookie = $this->getCookieDir(); $user = $this->getApiUser(); $curl = ...
0
votes
1answer
433 views

Magento 2 - Load Balancer - Health Check Failing - 302 redirect

I am having an issue with my load balancer health checks. It is attempting to access the server hosting the Magento 2 site. When I curl the IP address of the machine I get the following Response ...
2
votes
0answers
40 views

Why 2 classes Magento\Framework\HTTP\Client\Curl and Magento\Framework\HTTP\Adapter\Curl for same purpose?

Magento Framework has 2 classes for Curl operations: \Magento\Framework\HTTP\Adapter\Curl and \Magento\Framework\HTTP\Client\Curl What is specific use-case for each as both are capable of doing ...
0
votes
1answer
124 views

Magento 1.9.2.4 cURL issue

I am using Magento 1.9.2.4 and my Magento Connect is not working. Whenever I click check for updates, everything from the bottom disappears, please check the image below: When I try to update Magento ...
2
votes
1answer
147 views

Magento 2 Curl Rest Endpoints

I'm trying to access the REST Endpoints: POST /V1/products/special-price POST /V1/products/special-price-information POST /V1/products/special-price-delete I want to achieve this through PHP code ...
1
vote
0answers
217 views

Magento2.2.2 Backend Curl CURLPROTO_HTTP undefined

This is an odd one: I've just updated my to macOS High Sierra installed missing extensions Frontend it's all good Backend Admin login fine But when logged in get Exepction: > 1 exception(s): ...
2
votes
1answer
479 views

Magento 2 Api/Data, When To Create It?

I have fairly simple REST API request to get guest country code by his ip. In my block file this works perfectly fine when using curl: $url = "http://........./".$guestIp."?access_key=".$...
0
votes
3answers
332 views

Could not update password using customer ID in Magento-2 REST API

I am facing one issue. I am trying to update the customer password using Magento-2 REST API but the password could not update. I am explaining my code below. $adminUrl='http://domain.com/index.php/...
1
vote
1answer
100 views

Magento2 : Getting error while updating the data using API

I am getting the following error while updating the record using the Magento 2 REST API. Error: ( [message] => Request does not match any route. [trace] => ) I am ...
2
votes
0answers
28 views

curl is not operable because of some missing dependecies

Anybody know what it means this error message? And how to solve it? We want to install an extension for Full Page Cache in our Magento Store version 1.9.3. We use Apache Debian 9 for our server.
1
vote
1answer
323 views

How to write Curl code to Magento 2 code

This is my curl code. How to write the same in Magento 2 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, ...
3
votes
2answers
696 views

Magento 2 and ElasticSearch errors. Connection Failed. Test again?

i need some help with configuring my elastic search on magento 2.2.3 and i'm using ES 2.3. I login and configure here: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search. ...
0
votes
3answers
952 views

Magento 2: convert curl response into array

I am not able to convert magento 2 JSON response into array. Can you please help in short out this problem? Here is my code: $url = 'http://example.com/api/coop'; $post = [ 'firstname' => ...
0
votes
1answer
123 views

Magento 2 : CURL Use in Observer

I am using event customer_register_success for sending customer detail to a third party website. I am facing problem in implementation of CURL in event observer. Do you have any example of using CURL ...
1
vote
3answers
1k views

How to list all products from API with curl command line?

I've been trying a lot of things and can't seem to figure out what should be pretty simple... How can I make a request with curl in command line to /index.php/rest/V1/products so that I simply get the ...
0
votes
1answer
2k views

Guide for API to third party application from inside Magento 2

The important questions i would like to know are: Can I call a CURL from inside a Model or ResourceModel? Is there any standardized way to handle API's to third party apps? Please keep in mind that, ...
0
votes
3answers
1k views

SOLVED - Api token request Curl returns NULL

I am trying to get a token from my Magento 2 API, my script returns NULL, the call is working fine in Postman and generating a token : $adminUrl='https://www.xxxxxxx.com/rest/V1/integration/admin/...
2
votes
2answers
4k views

magento 2 : How to use curl? [duplicate]

I am trying to to create the curl request but it is not working. It is giving the error Uncaught Error: Class 'Custom\Rma\Helper\Varien_Http_Adapter_Curl' not found Code $header = array( ...
0
votes
1answer
102 views

Unable to add product into cart from third party CURL

I have created custom controller in which I've written custom add to cart action and shared controller URL with 3rd party website. That website is calling my controller using CURL and on success, 3rd ...
1
vote
4answers
2k views

how to fix php curl extension error while installing magento 2

How to fix php curl extension error while installing magento 2? I attached the Screenshot
0
votes
1answer
371 views

Rest api - create customer

I follow this Magento guide to work with Magento API REST (New Learner): http://devdocs.magento.com/guides/v2.2/get-started/order-tutorial/order-create-customer.html In this step I try run this curl ...
1
vote
1answer
2k views

Magento 2 REST API -> PUT example (PHP)

I'm new to the Magento 2 REST API (this is also my first post in this forum, hi all), but during the past day have been able to retrieve information using it to my backend system. GET -requests are ...
2
votes
1answer
490 views

cURL with Magento 2

I need to make cURL requests within my Magento 2 instance to an external source. As far as I can see there are 3 options Use native PHP Use Magento\Framework\HTTP\Adapter\Curl which uses Zend Use ...
0
votes
1answer
482 views

How to get an array from curl response

Use curl in custom module Magento ver 1.9.x In /var/www/html/magento193/app/design/frontend/base/default/template/reviewrating/rightsidebar.phtml $url = "http://mywebsite.com/api/extentionReviews?...
4
votes
0answers
229 views

Add CURLOPT_HTTPHEADER to Magento 2 curl

Currently i'm using magento 2 curl framework to connect to rest api like this: public function __construct(\Magento\Framework\HTTP\Client\Curl $curl ) { $this->_curl = $curl; } private ...
0
votes
1answer
564 views

Magento 2 rest API returns false when trying to get a token

I am trying to create a web app that gets data from a Magento 2 website thanks to the API, following this tutorial but it returns bool(false) when I do var_dump($token) I have read other threads on ...
1
vote
2answers
148 views

Unable to create customer using curl command

I am new to magento. I am facing an issue will trying to create customer using curl command. I am passing the correct json values as customer data as well, but still getting decoding error.Can some ...
2
votes
1answer
5k views

Magento 2 - Curl Method coding standard?

I am calling third party API using below methods: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->_url . 'api/v1/ShipTos'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); ...
1
vote
0answers
183 views

Not able to login to admin panel after updating curl

I am not able to login to my website admin panel,I have checked all the possible solutions available on Google,tried to reset the admin password,cleared the cache,done the changes in varien.php as ...
5
votes
1answer
533 views

Difference between adapter curl and client curl in magento 2

I came across two methods for making a CURL call in Magento 2. Magento\Framework\HTTP\Adapter\Curl Magento\Framework\HTTP\Client\Curl Paypal uses the First one as a factory Method to make ...
4
votes
3answers
3k views

Magento 2 curl POST with JSON body

i've tried to do some curl post to my other services using built in magento curl. i already did this for the curl request $this->curl->post($url, $data); yeah it's work but my data ...
0
votes
2answers
1k views

Magento: curl_setopt_array() error

I downgrade php7 to php 5.6,now my magento site not working its getting error ( ! ) Fatal error: Call to undefined function curl_setopt_array() in /var/www/html/rmcstore/lib/Varien/Http/Adapter/...
0
votes
1answer
352 views

How to insert Image of product programmaticaly through url

How to insert image in magento product via url. Products are inserting but without images $urlToImage = 'image'; has the url of image. and How do i insert products option? <?php ...
0
votes
2answers
1k views

How to Add Custom Options programmatically [duplicate]

Products are inserting, but the custom options are not inserting. $mageFilename = '../app/Mage.php'; require_once $mageFilename; Mage::setIsDeveloperMode(true); ini_set('display_errors', 1); Mage::...
0
votes
2answers
143 views

Inserting Products data programmatically

I'm getting product data from different store via curl call.Now i want insert all the product in my magento store. But only 3 products are inserting than i'm getting this error Uncaught exception '...
0
votes
1answer
2k views

Call to a member function getModelInstance() on null

Getting products from curl request from other store but unable to save data in magento. I'm getting getModelInstance() fatal error. Here is my code <?php $mageFilename = '../app/Mage.php'; ...