I am now attempting to get my betfair communication working
using bash (winbash) and curl. I can successfully login
and get a session ID but now am failing to get "list all
event types" to work.
My bash code looks like this:
================================================== ========
# List all event types, providing app key and session token
function list_all_event_types() {
echo
echo
echo
echo "LIST ALL EVENT TYPES"
echo
echo "SESSION_TOKEN:["$SESSION_TOKEN"]"
echo "APP_KEY:["$APP_KEY"]"
echo "HOST:["$HOST"]"
echo
echo "About to call curl command"
OUT=`curl -s -X POST --header "Accept: application/json" --header "Content-Type: application/json" --header "X-Application: $APP_KEY" --header "X-Authentication: $SESSION_TOKEN" --data "{\"filter\":{}}" $HOST/rest/v1/listEventTypes/`
echo "Curl command called, now print the output"
echo $OUT
echo "Output printed"
}
================================================== ========
But when I call it I see this:
================================================== ========
LIST ALL EVENT TYPES
SESSION_TOKEN:[xVEdQVCMVX/8NwMhEja9iyGRZqDUlAH2U2xWWUWKVpw=]
APP_KEY:[MakJhXosuq9sbQIr]
HOST:[https://api.betfair.com/exchange/betting]
About to call curl command
Curl command called, now print the output
Output printed
================================================== ========
As you can see the output from the curl command appears to
be empty.
Any ideas?
using bash (winbash) and curl. I can successfully login
and get a session ID but now am failing to get "list all
event types" to work.
My bash code looks like this:
================================================== ========
# List all event types, providing app key and session token
function list_all_event_types() {
echo
echo
echo
echo "LIST ALL EVENT TYPES"
echo
echo "SESSION_TOKEN:["$SESSION_TOKEN"]"
echo "APP_KEY:["$APP_KEY"]"
echo "HOST:["$HOST"]"
echo
echo "About to call curl command"
OUT=`curl -s -X POST --header "Accept: application/json" --header "Content-Type: application/json" --header "X-Application: $APP_KEY" --header "X-Authentication: $SESSION_TOKEN" --data "{\"filter\":{}}" $HOST/rest/v1/listEventTypes/`
echo "Curl command called, now print the output"
echo $OUT
echo "Output printed"
}
================================================== ========
But when I call it I see this:
================================================== ========
LIST ALL EVENT TYPES
SESSION_TOKEN:[xVEdQVCMVX/8NwMhEja9iyGRZqDUlAH2U2xWWUWKVpw=]
APP_KEY:[MakJhXosuq9sbQIr]
HOST:[https://api.betfair.com/exchange/betting]
About to call curl command
Curl command called, now print the output
Output printed
================================================== ========
As you can see the output from the curl command appears to
be empty.
Any ideas?


Comment