Questions tagged [curl]
Specify questions about cURL which provide library and command-line tool for transferring data using various protocols.
84
questions
0
votes
1
answer
629
views
How to use curl in magento 2 method?
I have a curl script to send sms. Below is the code.
$userId = $this->gupShupConfig->getSenderUsername();
$password = $this->gupShupConfig->getSenderPassword();
$smsApiUrl = $this-&...
2
votes
1
answer
1k
views
Bad Request Your browser sent a request that this server could not understand
I am trying to make get an oauth acces token from magento but when i sent the data i receive this error.
Bad Request Your browser sent a request that this server could not understand
This is the ...
0
votes
1
answer
375
views
Magento2 - How to pass query parameter in curl get method
I have a curl request example, it is working once I'm checking it with command line.
curl https://api.stripe.com/v1/payment_intents/search -u secret key:
--data-urlencode query="status:'...
0
votes
1
answer
288
views
Convert Php Curl to MAgento2 Curl
I have created this code but now I want to convert this code to magento2 curl library
$ch = curl_init();
//curl_setopt($ch,CURLOPT_USERAGENT, $user_agent);
...
0
votes
1
answer
165
views
Magento how to download plugin directly by link via curl or wget
I would like to download single plugin zip file with curl or wget and I always get FORBIDDEN response.
As an example let use this magento-language-es_es-100.4.0.0.zip it's available under
https://repo....
2
votes
1
answer
198
views
How to use curl in magento 2 cron?
I have cron set up which will run to import the data using the curl. I want to use curl using magento's way
0
votes
0
answers
372
views
Magento2 : How to send a request for a page and get the page status?
I want to check if the status of the page is not 200, then add it to the array along with the status and send it to the mail at the end of the script
I can't finish the code, tell me how to implement ...
0
votes
0
answers
599
views
Cant get Admin Token using cUrl 403 error
I've managed to get the API Token using Postman however, when I try to get the admin token through a cUrl request it returns a 403 error.
Postman Post Request:
https://localhost/index.php/rest/V1/...
0
votes
1
answer
476
views
curl_exec issue in Magento 2.4.1 and PHP 7.4.x
I have following code in the Magento site for getting external site data in PHP file, this worked fine in Magento CE 2.3.6 site but getting HTTP error code 400(Bad Request) after upgrading Magento to ...
0
votes
0
answers
126
views
How to add a script in a phtml file
I currently have a email pop up modal in my magento CMS but I need to hide the api so my script I will keep server side in PHP.
My question is how can I have a phtml that is just a script be imported ...
0
votes
1
answer
1k
views
Using REST API with admin username and password is good or safe in Magento 2
I am using REST API in Magento 2.
For using in Guest user i want to create admin token so i have used CURL Request like this.
$ch = curl_init();
$userData = array("username" => "...
0
votes
0
answers
286
views
Curl request doesn't login to my API, why?
I've been working on this code to log in to my API. But every time I try to login using CURL I get the following error
{"message":"The request entity's media type 'multipart/form-data' ...
0
votes
1
answer
35
views
I added a Curl.php file in another location. Now I have a Fatal Error when accessing the backend of my store
I added a Curl.php file in another location. Now I have a Fatal Error when accessing the backend of my store. (Yes, I deleted the other location already, but I still receive the error) Does anyone ...
0
votes
1
answer
224
views
Magento2 : Add simple product with custom options To cart Rest API
hello I need to Add simple product with custom options To cart throw Rest API I succeeded t add the simple product , price is correct and every thing is ok but unfortunately I didn't succeed to add ...
0
votes
1
answer
905
views
Using curl with graphql issue
I made the schema.grapqhs with this content:
type Query {
quoteData (
id: Int @doc(description: "Id of the Quote Data")
): QuoteData @resolver(class: "Vendor\\Module\\...
2
votes
1
answer
696
views
Change Magento 2 website based on IP
I have 3 websites in my current Magento installation and are as follows website1 Code: base, website2 Code: au, website3 Code: ca. Each website has one store and one store_view except for website3 ...
1
vote
1
answer
448
views
Magento 2: file_get_contents and curl not working on server
file_get_contents and curl not working on server but working well in local.
And also allow_url_fopen = On.
$b1 = "https://www.demo.com/";
$response = file_get_contents($b1);
print_r(...
0
votes
1
answer
368
views
Curl magento 2 store on docker
I'm trying to curl a docker dev install from itself
using Magento\Framework\HTTP\Client\Curl
I get a failure and the result SSL certificate problem: self signed certificate
Got the options set
$this-&...
0
votes
1
answer
548
views
Magento 2.3.5 Checkout Shipping Methods cURL error 7 Exception
Magento Version: 2.3.5p
Hey guys, I am not sure if you have gotten a similar error during checkout:
Internal Error. Details are available in Magento log file. Report ID: webapi-5ed2c83e06062
...
0
votes
1
answer
178
views
Display curl result on phtml
I created a custom module to fetch data from an external API and I would like to display it on the frontend.
I put my curl function in Helper\Data.php - Is it the best place to put it?
I called ...
0
votes
1
answer
416
views
How to display products with limits and offset
I have displaying products using following url
host/index.php/rest/V1/products?searchCriteria[page_size]=20
Now displaying 20 products in page. i want 20 in first page, 20 to 40 products in second ...
0
votes
1
answer
344
views
Product with image adding on magento2 using curl php. it shows error '{"message":"Specified request cannot be processed."}
json data body datas are..
"entry": {
"id": 0,
"media_type": "image",
"label": "Image",
"position": 1,
"disabled": false,
"...
0
votes
1
answer
381
views
How to call CURL in magento 2 for curl_getinfo($ch, CURLINFO_HEADER_SIZE)
$ch = curl_init($url);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
How to call in magento 2. I tried
$this->_curl->setOption(CURLINFO_HEADER_SIZE);
1
vote
0
answers
158
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
1
answer
270
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
1
answer
899
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',
...
1
vote
1
answer
148
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
1
answer
2k
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
3
answers
3k
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
1
answer
418
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()...
2
votes
1
answer
215
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 = "...
2
votes
0
answers
951
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
1
answer
2k
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
1
answer
2k
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 ...
3
votes
1
answer
655
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
1
answer
306
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
1
answer
948
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 ...
2
votes
0
answers
1k
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
1
answer
2k
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
3
answers
923
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
1
answer
353
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
0
answers
32
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
3
answers
2k
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
3
answers
3k
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
3
answers
3k
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
1
answer
462
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
3
answers
3k
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
1
answer
5k
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, ...
1
vote
3
answers
6k
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/...
4
votes
2
answers
12k
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(
...