相关疑难解决方法(0)

wget发布数据中的变量

我正在使用一个简单的bash脚本从Tumblr网站下载图像.我的想法是用来read从用户那里获取登录信息,然后wget --post-data登录,这就是我所拥有的:

read -p "Tumblr login email: " EMAIL
read -p "Tumblr login password: " PASSWRD
wget --user-agent=Mozilla/5.0 --save-cookies cookies.txt --post-data 'email=$EMAIL&password=$PASSWRD' --no-check-certificate https://www.tumblr.com/login
Run Code Online (Sandbox Code Playgroud)

但是,它是发送"$EMAIL""$PASSWRD"不是变量的字符串,有没有办法让它发送用户输入的值?

variables bash wget postdata

28
推荐指数
1
解决办法
9万
查看次数

wget for Windows - 使用--post-data with quotes

我正在使用Windows的wget,我想指定一个--post-data过滤器(并避免使用--post-file过滤器),但我很难让它工作.这可能是因为双引号内有字符串,如下所示:

wget "http://www.somesite.com/wfs" --header="Content-Type: text/xml; charset=UTF-8"
--user=username --password=password --no-check-certificate
--post-data="big long string with "quotes" in it" --output-document=C:\Test.xml
Run Code Online (Sandbox Code Playgroud)

有没有其他人成功地--post-data在wget for Windows中工作?我错过了什么吗?

干杯

安迪

post wget

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

wget ×2

bash ×1

post ×1

postdata ×1

variables ×1