Questions tagged [curl]

cURL, known for its versatility in data transfer across multiple protocols including HTTP, FTP, and SFTP, is both a powerful library and a handy command-line tool. Particularly, the cURL project encompasses two distinct yet interconnected products: libcurl and curl. Irrespective of whether one utilizes libcurl or curl, this tag encompasses all applications involving cURL.

Utilizing CURL for PHP to extract information from any webpage

Can a PHP function be created to generate an HTML string of any link like a browser does? For example, links such as "", "", "mywebsite.com", "somesite.com/.page/nn/?s=b#85452", "lichess.org" What I have attempted: $curl = curl_init(); curl_setopt($curl, ...

The integration between curl_exec and Mailchimp fails to function properly when implemented with AJAX

I have successfully set up a form within my Wordpress site to send data to Mailchimp using their API. When I use a standard form that redirects to a designated page, everything works smoothly and all the data gets imported as expected. However, I am now t ...

Error encountered with Google OAuth2 - A necessary parameter is absent: grant_type when attempting to refresh

As part of my project, I developed a prototype calendar synchronization system using the Google Calendar API which functions well, except for the issue with refreshing access tokens. Here are the steps that I have followed: 1) I authorized my API and obta ...

Performing an OAuth2 request using AngularJS

I'm attempting to utilize AngularJS to request an access token, but I am uncertain about the proper approach. Below is the curl request that I have: curl -X POST -d "grant_type=password&username=&password=&scope=read" -u":" http://l ...

Utilizing Airflow's web API to generate a JSON variable

Attempting to set up a variable with a JSON value in Airflow using the web API. Here is my script: curl -X POST "${AIRFLOW_URL}/api/v1/variables" -H "Content-Type: application/json" --user "${AIRFLOW_USERNAME}:${AIRFLOW_PASSWORD}" ...

Can you provide a visual representation of the JSON structure?

$data = array('name'=>'John', 'age'=>25, 'city'=>'New York'); I am practicing my PHP skills by using cURL for making a POST request. Assuming the given array is converted into JSON format, what would the resulting JSON string appear as? ...

What is the best way to send a CURL request to an IP Address using PHP?

I've been attempting to send a CURL request to an IP address, but for some reason it keeps failing without any clear explanation. Here's the code I'm working with: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"127.0.0.1/script.php"); cu ...

Switch from using a curl query to making an ajax query with mootools

My current approach involves using curl to fetch json data from nuxeo. Below is the function I am currently using: curl -X POST -H "Content-Type:application/json+nxrequest" -d "{ params: { query:'SELECT * FROM Document' } }" - ...

Webduino successfully accepts POST parameters from curl, but is unable to receive them from Node

Check out the code snippet below to see the Arduino in action using the Webduino library: void handleConfigRequest(WebServer &server, WebServer::ConnectionType type, char *, bool) { // Processing POST request for new configuration if (type == WebServ ...

Zero value is requested using the GETS method

Hey there! I'm currently working on extracting the request method when a URL is requested from my localhost. To achieve this, I've implemented URL rewriting so that http://localhost/API2/products.php?product_id=1 is transformed into http://localh ...

Having Issues Getting Results from Curl Post Scraping

I am trying to scrape data from the website marcanet.impi.gob.mx/marcanet/controler/RegistroBusca using the code below, but I am unable to reach the result page. $form_url = "http://marcanet.impi.gob.mx/marcanet/controler/RegistroLista"; $data_to_post = a ...

Send JSON data to Riak using the `curl` command

I am working with a JSON object: { title: "Some title", author: "Name", text: "This is text..." } My goal is to save this JSON data to my Riak database using the curl command as follows: curl -v -X PUT http://192.168.56.12:10018/riak/news/news1 ...

Exploring Node and Express: Uncovering all custom methods using the .all() function

As I work with Node and Express, my goal is to capture all traffic directed towards a specific URL using the following code: APP.all('/testCase', function(req, res) { console.log('I am called with the method: ' + req.method); }); When I execute curl ...

Using cURL in PHP to Handle JSON Data

I am trying to replicate the functionality of a website that uses AJAX POST requests using CURL in PHP. Typically, when monitoring POST requests with Firebug, you would see variable/value pairs. However, in this case, all you see is a single JSON string. ...

Utilizing MIME to send emails through the Mailgun API, bypassing the need for the Mail

Currently, I am utilizing PHPMailer to generate an email as a MIME string and my intention is to send it through the Mailgun API by using curl to connect to the endpoint /v3/[mydomain]/messages.mime. According to the instructions in the Mailgun documentat ...

Sending variables to CURL Object (POST)

I am facing an issue with a CURL object where I get an error when passing a variable to it. Strangely, the CURL post works fine when the value is hardcoded. The variable is correctly set as confirmed by echoing its value on the screen. $tVA = "false"; ...

Uploading a file to FastAPI server with CURL: Step-by-step guide

I am in the process of configuring a FastAPI server that is capable of accepting a single file upload from the command line through the use of curl. To guide me, I am following the FastAPI Tutorial located at: from typing import List from fastapi import ...

Having difficulty fetching and storing user's profile image using cURL

My attempt to retrieve a user's display picture through the Graph API and save it to disk using cURL has hit a roadblock. I'm encountering an error when trying to check the mime type of the saved picture: Notice: exif_imagetype(): Read error! in ...

Unable to access Heroku login using cURL and PHP

A straightforward PHP script I created for logging into a specific webpage runs smoothly on my localhost using Wamp server. However, when I attempt to run it on Heroku, I encounter a response like this: [image link](https://i.stack.imgur.com/uilks.png). ...

Executing an authenticated Guzzle POST request

Just starting out with guzzle and I need help on how to make a Guzzle call for this specific request. curl -X POST -u username:password -H "Content-Type: application/json" https://xyz/api/v1/accounts.json -d '{"user":{"username":"test","password":"xyz","f ...

Using the CURL function to extract the encoded URL from the GET request

I am currently facing an issue with passing a URL from GET and using it in a curl request, as the URL needs to be encoded. Even after trying to use the proper function, urlencode, I'm unable to make it work. It's possible that I am not initializ ...

Unable to successfully login using curl due to captcha verification not working

My attempt to access my home page post login using CURL has been unsuccessful. I suspect there may be an error in my code; could someone please review it and identify any issues? I have tried multiple approaches but have consistently failed. It seems that ...

Using CURL to connect to my personal network at home

Hey there, I have set up my home computer to run an Apache server on port 5900 with a Dynamic DNS to keep track of the IP address. I can access my server's index page from a different network using MYURL.com:5900. Now, I want to send a message to my h ...

What is the best way to send a POST request with text beginning with @ and also upload a file using PHP cURL?

When I use PHP and cURL to make a POST request to the Twitter API, I often encounter an issue when including image data in the post. The text of the tweet also starts with "@" to mention a user. This is an example of my code: curl_setopt($ch, CURLOPT_POS ...

Troubleshooting Plesk 12 API Connection Issues due to cURL Connection Reset

I'm currently utilizing cURL to send requests to the Plesk API. Whenever I attempt a request that involves extensive processing by Plesk (like creating or deleting a subscription), I encounter a "connection was reset" error in my browser after approx ...

Sending JSON data in a POST request using Java's HttpUrlConnection

After spending time developing a Java code to convert the cURL request below into Java using URL and HttpUrlConnection, I've hit a roadblock. The original cURL is: curl -i 'http://url.com' -X POST -H "Content-Type: application/json" -H "Acce ...

npm is currently unable to fetch packages from the registry at registry.npmjs.org

I am encountering the following error message when trying: npm search rollup npm ERR! pna.nextTick is not a function npm ERR! code ECONNRESET npm ERR! network tunneling socket could not be established, statusCode=503 npm ERR! network This is a problem re ...

Using PHP to send a JSON request via cURL

I am attempting to make a cURL request in PHP. The request I am trying to send is as follows: $ curl -H 'Content-Type: application/json' -d '{"username":"a", "password":"b","msisdn":"447000000001","webhook":"http://example.com/"}' http ...

Error encountered while using the Braintree PHP SDK cURL functionality

Every time I attempt to generate a client token using Braintree_ClientToken::generate(), I keep receiving a Braintree_Exception_SSLCertificate exception. Despite having the SDK installed and meeting the minimum PHP requirements, I can't seem to figure ...

Learn about querying with PHP and CURL and how to store the response in a variable

Currently, I am working on incorporating CURL to retrieve a response in a PHP web application. curl -d "qid=QID&api_key=API_KEY&api_sig=API_SIG&time_stamp=TIMESTAMP" http://api.1.com/v1.2/result/ All the variables required are known to me, ...

Transitioning from a traditional CURL method to utilizing AJAX and XMLHttp

I'm currently facing a challenge converting the curl code from an API named TextRazor to AJAX XMLHttp due to limitations on the platform I am working with. Despite trying various solutions shared by the community, I have been unsuccessful in retrieving any ...

The attempt to fetch the submitted data via the PHP URL was unsuccessful

I have a form and I've created a URL to fetch data. The data is being fetched properly, but when I try to access the URL, it shows {"error":"null"}. How can I retrieve the submitted value? I am having trouble displaying the web services as I attempt to cre ...

Query on PHP curl

Can anyone explain why this code is getting stuck? It functions perfectly fine when the break statement is commented out, but only for the initial item in the $sitelist array. I am aware of PHP curl's multisite feature, but my focus is not on retrieving f ...

Transmitting information to a server with PHP and cURL

I am encountering an issue while trying to send the following data to my server via API. Request Body: { "nutrients": { "protein": "beans", "fats": "oil", "carbohdrate": "starch" } } Every time I execute the script, the error message bel ...

What is the best method to extract data from a cURL request in a WordPress website?

This is the header: GFC-X-PORTER-PIPE: wZ5u8QgsCsTKR2Wz Content-Type: application/json When making a GET request using curl(like the example below): curl -XGET -H "GFC-X-PORTER-PIPE: wZ5u8QgsCsTKR2Wz" -H "Content-Type: application/json" "" RESUL ...

Can I rely on fopen to execute a cURL operation with file upload securely?

I have implemented an upload system that utilizes Dropbox's API to send files. The receiving .php file that performs a cURL operation looks like this: $localFile = $_FILES["file_key"]['tmp_name']; $fp = fopen($localFile, 'r'); $ch = curl_init(); curl_se ...

Retrieve the full web address from a webpage

I am currently using the following PHP code to extract links from a URL, however, it returns a mix of absolute and relative URLs. I am looking to modify this script so that all links are converted into absolute links within the same script. <? $requ ...

What could be causing my PHP script to fail when attempting to copy a folder to a different directory on box.com?

In my current project, I am utilizing PHP cURL to duplicate a folder into another directory as a subfolder. Below is the set of cURL options (hidden CODE value) and the operations involved: array ( CURLOPT_SSL_VERIFYPEER => true, CURLOPT_VERBOS ...

Update a scheduled task from invoking through a URL with cURL to invoking through the local command line using PHP

I currently have a cron file named cron.php. Within this file, I am implementing the curl_multi approach to initiate sub parallel tasks. For example, the crontab in cpanel will execute this script every minute: curl http://mywebsite.com/cron.php Within ...

Tips for resolving the UNABLE_TO_GET_ISSUER_CERT_LOCALLY issue while attempting to install Sentry using npm or curl

https://i.stack.imgur.com/G8hfZ.png curl -sL -k https://sentry.io/get-cli/ | bash Even though I've specified not to verify the certificate with -k, I'm still facing issues trying to install it. The script is supposed to automatically install sen ...

Execute jq with the curl/bash command

I want to create a script in bash that retrieves the final URL after redirection. For example, when google.com is redirected to http://www.google.com with a status of 301, I want to capture that redirect. Here's what I have attempted so far: json=&ap ...

The behavior of curl_multi_exec varies with each run

While using curl_multi_exec() for only 5 URLs, I encountered a peculiar issue. When running my code on xampp, everything works perfectly fine - $running starts at 5 and gradually decreases. However, when testing it on another localhost with an ARM architec ...

Implementing Basic Authentication with CURL in integration with the Fastbill API

I am struggling with authorizing a user login because I am unsure of the correct syntax. My goal is to modify https://github.com/ZWEISCHNEIDER/fastbill to enable the login API-wise. The current header code that works is as follows: curl_setopt($ch, CURLO ...

Troubleshooting API password issues when fetching a Json from an API using VBA in Excel

I'm facing challenges with an API that provides natural gas data. The documentation for this API can be found at . It allows me to access Json-formatted data by inputting a URL into my internet browser. However, in order to download the Json data, I need t ...

Experiencing issues with npm installation and Git usage following the upgrade to MacOS Mojave 10.14.4 (18E226)?

Initially, the system works fine after a restart. However, I repeatedly encounter the following error: curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to ssl.icu-project.org:443 and request failed ... read ECONNRESET This issue arises c ...

Using cURL for PHP JSON parsing

I am trying to develop a basic webpage that displays the current region based on the user's IP address. To achieve this, I am utilizing an API provided by freegeoip.net. Even though I have successfully configured the code to send the user's IP to the API a ...

No files were found in the request when using PHP's cURL

I need assistance in converting this curl request to PHP. curl -X POST -F "file=@test_img.jpg" "http://127.0.0.1:5000/FileUploading/UploadImage/"test_img.jpg" The above curl request works properly with the following flask-RESTful code class UploadImage( ...

Utilizing curl to interact with an associative JSON array

I have an array that I need to send: $nums = [ [ 'title' => 'How to build a basic module', 'summary' => 'The summary', 'description' => 'The description', 'created_at' =& ...

Generating assignments within the Bitrix platform

Is there a way to automatically create tasks in Bitrix from my website form submissions? Ideally, when a user submits a form on my website, can it trigger the creation of a new task in Bitrix that is then automatically assigned to a specific user? ...

Unveiling the Art of JSON Parsing and Effectively Accessing

I am currently using CURL for sending a request and the response received is in JSON format. I need help with parsing this data and inserting it into my database. <?php $url = 'http://example.com/api/endpoint'; $phoneNumber = '1234567890'; $message = ...

powershellUsing the cURL command with a PHP script

I am having trouble sending JSON data from the command line with curl to a php script and properly receiving it on the server-side. Here is what I have attempted so far: Running the following command in the command line: curl -H "Content-Type: applicati ...

What is the reason behind the timeout of an API request made to a local installation of Gitea?

I'm currently facing an issue while migrating a private github repository to my locally installed instance of Gitea. In order to accomplish this, I've set up a Docker container on a NAS in my home. Initially, I attempted to use the built-in migration featu ...

Guide to utilizing an alternative server IP address using PHP and cURL

Is there a way to specify a particular IP address for cURL to use when making requests on my server with multiple assigned IPs? ...

Share your thoughts on Facebook using the curl command

I am hoping to have my website post a message on the fan page of the site. After finding this code, I decided to use it: <?php require_once("assets/facebook.php"); $facebook = new Facebook(array( 'appId' => '471898006354908', // Placeholder 'secr ...

What are the reasons for steering clear of using apt-get to install Node.js on Ubuntu?

What are the reasons for avoiding the installation of Node.js with apt-get on Ubuntu? And, how does utilizing curl and the nodejs PPA resolve this issue? (Tip: The issue is related to the ability to install npm modules globally. However, why should we even ...

There seems to be a problem communicating securely with the server due to an SSL handshake failure with error code 14077410

$ch = curl_init(); $clientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/oauth2/token"); curl_set ...

Retrieve the name lookup time in 10 seconds using curl command

When performing a basic curl request in PHP to a simple text webpage (), the response time exceeds 10 seconds. Upon examining the information provided by curl, it indicates that the namelookup_time is 10 seconds. The same outcome is observed when running ...

I am unable to retrieve the information sent through CURL using the POST method

Recently, I started using Postman to send a POST request to an "Api server" built with Codeigniter 3 (which only prints the $GLOBALS variable). However, when I make the call, the body data doesn't appear. So, I decided to try a small script using CURL: $cu ...

The File API functions properly with cURL, but encounters issues when used with AJAX and Postman

I currently have gotenberg running as my chosen document to PDF conversion API and it is successfully functioning with the use of cURL. The command I utilize with cURL is structured like this: curl --request POST --url http://example.com --header ' ...

Using curl to display JSON data in an array: A simple guide

I have written some code to retrieve JSON data using Curl. I am now looking to display all the retrieved data, but it seems to be not showing any output. <?php $json = file_get_contents('myurl'); $data = json_decode($json); print_r($data); ?& ...

The server-side script using CURL is unable to receive the posted values

My application utilizes php and CURL for sending data to a server using the curl post method. I am facing an issue where the json string that is being posted contains values like "state":"jammu & Kashmir". However, when I attempt to retrieve this dat ...

Limit the size of files to be unzipped using shell_exec

Currently, I am utilizing the following code to download a zip file from an external server that contains more than 1,000 images. The process of downloading and creating/copying the source zip file onto my server is successful, but for some reason, the cod ...

Guide to utilizing CURL and SAML TOKEN authentication for invoking REST APIs

Here is an example of my URL: https://<ip:port>/TestRESTServices/objects/test-folder Below is the JSON data I would like to send: { "name":"test-1", "parent-uuid":"126" } I am trying to create a folder named test-1 by making a POST request ...

Express POST request body is required

I am starting to learn nodejs and express, and while reviewing some code I found this interesting snippet. Can someone please explain what it means and how I can send a POST request to it using cURL? There are no specified data fields. app.post('/&apo ...

Sending a cURL POST request to a Node.js express server running on an NGINX server resulted in a 502 error response

I am attempting to send a POST request to one of my node API routes. Strangely, only one of them seems to be working properly. I'm not certain whether this is an issue with NGINX, Node.js, or a combination of both. I have double-checked everything and ...

Issues arising from the utilization of SimpleXMLElement with XML data extracted from mobile.de

My goal is to retrieve XML data from mobile.de for my plugin's data preparation. The XML returned appears as follows: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <reference:reference xmlns:seller="http://services.mobile.de/schema ...

Having trouble establishing a connection to the server through curl

Whenever I attempt to send a request to the server on localhost, I keep getting this error message: Error: call to URL failed with status 200, response {"resultCode":503,"resultMessage":"Yakeen Failure: The ID Is Not Found at NIC","referenceNum ...

Issue with securely configured proxy: Meteor failure due to inability to establish tunneling socket with SSL?

Currently utilizing Meteor on Ubuntu 14.04.5 LTS within a corporate proxy environment, I am encountering issues applying updates or even establishing a Meteor instance. Upon running meteor update, the following error is displayed: Unable to update package ...

Guide on incorporating curl in Java and extracting JSON feedback

Is it possible to use a curl command that provides a JSON response in Java and parse the JSON response using Java? Here is an example of Java code attempting to achieve this: public static void main(String[] args) throws Throwable { try { In ...

Receiving a WAV audio file via HTTP POST on a Node/Express server

I am attempting to transfer an audio file named audio.wav using cURL to my Express server. The cURL request I am using is as follows: curl -X POST --data-binary @"audio.wav" -H "Content-Type: audio/wav" localhost:3000/extract_indicators/audio/darksigma ...

Tips for creating a PHP cURL request using the provided documentation

Can anyone help with creating a PHP cURL based on the following documentation? Here is the raw curl text: curl --location --request POST '/serviceRates' --header 'Content-Type: application/json' --header 'access-key-id: ***' --header 's ...

What steps can I take to confirm that my cURL POST request is correctly executed in PHP?

I am faced with a challenge of handling a sample json object that contains specific data. My goal is to effectively store this information in a variable and then transmit it through a curl POST. $json = '{ "mac": "1234567890", "dns": "8.8.8.8 ...

When attempting to save a base64 code to a directory, I encounter an issue where the image fails to load and cannot be accessed

I've been facing an issue where I try to save an image into a folder in my project, but the saved file appears corrupted and cannot be viewed or opened. Here's how I'm handling it: First, I receive the image through a form where I capture t ...

How can I add a space in a JSON string when using curl on Windows?

Whenever I make this curl request (executing on a Windows cmd prompt): curl --insecure -g -X POST -H "Content-Type: application/json" -d {\"from\":\"someName\",\"message\":\"this is a message\"} https://some/website ...

Emulating cURL Functionality in PHP

I am encountering an issue with my PHP code that is causing a problem when trying to execute a curl request. The same curl request works perfectly fine on my shell, but for some reason, it's not functioning correctly in PHP. Below is the code snippet wher ...