Quantcast
Channel: Getting empty data while reading text file and send read data to url by cURL in linux - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Getting empty data while reading text file and send read data to url by cURL in linux

$
0
0

I have text file called read_data.txt in /var/www/html/ directory. I want to read data by curl while file contents will change. So I have created a bash script. It is reading data while the content is changed, and sends the content over mail. But instead of mail, I want to send that data to a specific url.

I am using the script below.

curl -d data=@/var/www/html/read_data.txt" http://domain.tld/testing_receive_data/index.php/check_data_controller/check_data

The above URL is receiving all post data and converting post array to JSON data by json_encode php function and logs it.

curl -d data=@/var/www/html/read_data.txt" http://domain.tld/testing_receive_data/index.php/check_data_controller/check_data

When I am running above code in the Linux shell, the JSON data is shown empty: {"data"=[]}


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>