curl -G http://tinycorelinux.net/4.x/x86/tcz/nano.tcz.info
thanks for the suggestion
just curl works without fail (resty is just wrapper for curl)
..i have now found my previous post was not so clear even to myself !
i forget that i have used resty before with only core and curl needed
when i post before looking at th script didnt make much sense to me
i messed about just enough to see it can work
but it has grown a little more complex over time
now realize the link above was 'linked' to the latest revision of resty
and have eventually 'remembered enough' to know how some of the bits() of it link up
so now i found
https://github.com/micha/resty/tree/03c3cbdf6e76df18179f73a337a4e7d292119b79#initial commit
back in the day $h was simple
https://raw.github.com/micha/resty/03c3cbdf6e76df18179f73a337a4e7d292119b79/restyfunction resty() {
local RESTY_HOST=`cat ${HOME}/.restyrc 2>/dev/null`
local method="$1"; shift
local path="$1"; shift
local acpt="Accept: application/json";
local data
local res
case "$method" in
GET|DELETE)
res=$(curl -s -L -f -H "$accp" -X $method "$@" "${RESTY_HOST}$path")
ret=$?
[ "$ret" != "0" ] && resty $ret
echo "$res"
return $ret
;;
POST|PUT)
data="$1"; shift
res=$(curl -s -L -f -H "$accp" -X $method -d "$data" "$@" \
"${RESTY_HOST}$path")
ret=$?
[ "$ret" != "0" ] && resty $ret
return $ret
;;
http://*)
echo "$method" > ${HOME}/.restyrc
;;
*)
echo "resty: curl: returned error $method" 1>&2
;;
esac
}
function GET() {
resty GET "$@"
}
function POST() {
resty POST "$@"
}
function PUT() {
resty PUT "$@"
}
function DELETE() {
resty DELETE "$@"
}
case "$1" in
--pretty=*)
if [ "${1##*=}" == "on" ]; then
echo yes
export RESTY_PRETTY=1
else
echo no
export RESTY_PRETTY=0
fi
;;
*)
export RESTY_HOST="$1"
;;
esac
something like
sed -e 's/function/ /g' ./resty_initial >resty_initial.sh
and that is just about simple enough for me to understand
also i found
frioux/app-adenosine-prefab - "Adenosine was ported to Perl from resty due to a number of issues."
& that this is the last pre perl
resty from
#urlencode square brackets