[AWS] "Post Timeout" result from AWS.Client.Post?
Jacob Sparre Andersen
sparre at nbi.dk
Wed May 13 10:06:37 CEST 2009
Pascal Obry wrote:
>> I am working on a small tool, which sends two HTTP POST
>> messages to a web server; the first to log in, and the
>> second to fetch some data which only are available once I
>> am logged in:
>
> Which AWS version are you using?
2.5~124785-1 in Debian/stable.
As an extra bit of information, here's my working Unix shell/Wget
prototype for my Ada code, in case somebody can identify a trivial
misunderstanding in my conversion from Unix shell code to Ada:
#! /bin/sh
#-----------------------------------------------------------------------------
#-- User name an password may be changed:
username='XXX'
password='XXX'
#-----------------------------------------------------------------------------
cd "$(dirname "$0")" || exit
if [ $# = 0 ]; then
date_reference=yesterday
else
date_reference="$1"
fi
date="$(date --date="${date_reference}" +"%Y-%m-%d")"
mlx_date="$(date --date="${date_reference}" +"%m/%d/%Y" | sed 's|^0||; s|/0|/|;')"
if [ -z "${date}" -o -z "${mlx_date}" ]; then
echo "Bad date format. Please use:" 1>&2
echo " $0 YYYY-MM-DD" 1>&2
exit -1
fi
postdata='datevalue='${mlx_date}'&hdnAsofdate='${mlx_date}'&hidCuspID=&ColState=&hdnSrcApp=&hdnPortID=&hdnMthEndDate=&hdnViewState=&txtIndex=ERCT&txtFromDate='${mlx_date}'&SelOldNew=1&cboConfiguration=6840&cboFilter=0&iPage=&IndexVal=&Param1=&strWhere=&Param2=&SortVariable=&SortVariable1=&SortVariable2=&SortVariable3=&SortBy1=&SortBy2=&SortBy3=&SortString=&SortType=&Download=&OrderBy=&ConfigId=6840&CriteriaID=&NoOfConfig=&Source=1&ProfileName='
#-----------------------------------------------------------------------------
#-- We never reuse login data more than one day old:
if [ -e cookies.txt ]; then
touch --date=$(date --date=yesterday +%Y-%m-%d) timestamp
if [ cookies.txt -ot timestamp ]; then
rm -f timestamp cookies.txt
else
rm -f timestamp
fi
fi
#-----------------------------------------------------------------------------
if [ ! -f cookies.txt ]; then
wget --keep-session-cookies \
--save-cookies=cookies.txt \
--post-data='URL=/&hdnLoginFlag=1&TARGET=/_mem_bin/protected/entload.asp&REALMOID=&SMAUTHREASON=0&USER='"${username}"'&PASSWORD='"${password}" \
--output-document=login_page.html \
https://www.mlx.ml.com/siteminderagent/forms/login.fcc
fi
if [ ! -f data.${date}.csv ]; then
wget --load-cookies=cookies.txt \
--referer='http://www.mlx.ml.com/MLIndex/Bin/BondIndic.asp' \
--post-data="${postdata}" \
--output-document=data.${date}.csv \
http://www.mlx.ml.com/MLIndex/Bin/downloadindex.asp
fi
#-----------------------------------------------------------------------------
#-- Clean up:
rm -f login_page.html
#-----------------------------------------------------------------------------
Greetings,
Jacob
--
"Banning open source would have immediate, broad, and
strongly negative impacts on the ability of many sensitive
and security-focused DOD groups to protect themselves
against cyberattacks" -- Mitre Corp.
More information about the AWS
mailing list