shell - How to send input to a website from a LINUX script -


i have shell script takes input user, need feed input website. example

#!/bin/sh echo -n "enter name > " read name echo -n "enter age > " read age echo -n "enter marks > " read marks # these 3 inputs have feed automatically website  (e.g.abc.mydomain.com) has data field take input.  

you can convert data json format , use curl send post request website url data.

#!/bin/sh echo -n "enter name > " read name echo -n "enter age > " read age echo -n "enter marks > " read marks  curl -h "content-type: application/json" -d "{\"name\" : \"$name\", \"age\" : \"$age\", \"marks\" : \"$marks\"}" http://abc.mydomain.com 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -