Questions tagged [curl-request]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 views

How to handle if curl request throws error in magento 2

I am receiving a response from using a curl request. But how do I check whether my curl request throws an error or not? because it takes 15 minutes to give a response from API.(but it works fine while ...
0
votes
0answers
10 views

Want to create REST API Admin access authentication in module ? And get last order json data magento 2

I have found below code in magento stack exchange. but i dont know where to put this code in custom modules. $userData = array("username" => "admin", "password" => &...
0
votes
0answers
15 views

Hit a curl request at the time of add to cart in magento 2?

I want to hit an external curl request at the time of add to cart click in magento 2. Based on that result product will be added or not in cart How will i hit curl on add to cart click ?
0
votes
1answer
27 views

Requesting controller action via Curl request

I am sending a CURL request to a controller action and construct() function is working(calling) but it doesn't call the execute() function of the controller. For now, I am calling the execute() ...
1
vote
1answer
126 views

Error in Curl request with response in Controller

I'm trying to get curl response from js (cc-method.js) file. The curl call code is in controller file domain.com/frontname/section/index. Below is the code, public function execute() { // create ...
1
vote
1answer
82 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
0answers
94 views

Could not Add customer address using customer id using Magento-2 REST API

I am facing one issue while adding new address of a existing customer using its id. I am explaining my code below. <?php include('db.php'); $response=array(); $adminUrl='http://magento-148486-...
1
vote
1answer
780 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, ...
4
votes
2answers
8k 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
686 views

Magento 2 Rest Api call curl SSL Error

I have setup a custom Magento Rest Api at the endpoint: "https://domain-name.de/rest/V1/wawi". This Api just returns a simple json string. Have tested my Api with Postman application -> works fine. ...
2
votes
1answer
792 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 ...
4
votes
0answers
333 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
953 views

CURL request using DELETE method in Magento 2

I am trying to call a curl request for delete method using Magento\Framework\HTTP\Client\Curl.php. In this class makeRequest method is responsible for sending curl request. But as I can see that ...