Hi there. This is probably the only place that will have any knowledge of Borland long dead languages.
I am finding it impossible to login and yet it should be possible.
Here is the code that I am using but all I get returned is the entire script for the entire Betfair Pages. Any help or ideas would be gratefully appreciated and I have tried all sorts of alternatives. The strings in the Variables are not currently being used but will be later on and it processes ok but wont log me in.
method pushButton(Var eventInfo Event)
var
oaXMLHTTP oleAuto
encodedAuth,
APIKey,
APIpwd string
endvar
RequestURL = "https://identitysso.betfair.com/api/login"
resultXMLstr2 = ""
err1 = ""
isOK = false
msgStr="?username=xxxxxxxxx&password=xxxxxxxxxx" ; note xxxxxxxxx&xxxxxxxx - my username&password
try
whichStep = "msXML Open"
if oaXMLHTTP.open("Msxml2.XMLHTTP.3.0") then
whichStep = "HTTP Open"
oaXMLHTTP^open("POST",RequestURL, false)
whichStep = "Set Request Header"
oaXMLHTTP^setRequestHeader("Accept: application/json", "X-Application: <valid application string>")
whichStep = "Send Data"
oaXMLHTTP^send(msgStr) ; sync so it'll wait
resultXMLstr2 = oaXMLHTTP^responseText
isOK = true
endif
onFail
endTry
if not isOK then
errorShow(whichStep)
return
endif
resultXMLstr2.view("Returned") ; have to decode result from JSON
endMethod
Many thanks for any thoughts.
I am finding it impossible to login and yet it should be possible.
Here is the code that I am using but all I get returned is the entire script for the entire Betfair Pages. Any help or ideas would be gratefully appreciated and I have tried all sorts of alternatives. The strings in the Variables are not currently being used but will be later on and it processes ok but wont log me in.
method pushButton(Var eventInfo Event)
var
oaXMLHTTP oleAuto
encodedAuth,
APIKey,
APIpwd string
endvar
RequestURL = "https://identitysso.betfair.com/api/login"
resultXMLstr2 = ""
err1 = ""
isOK = false
msgStr="?username=xxxxxxxxx&password=xxxxxxxxxx" ; note xxxxxxxxx&xxxxxxxx - my username&password
try
whichStep = "msXML Open"
if oaXMLHTTP.open("Msxml2.XMLHTTP.3.0") then
whichStep = "HTTP Open"
oaXMLHTTP^open("POST",RequestURL, false)
whichStep = "Set Request Header"
oaXMLHTTP^setRequestHeader("Accept: application/json", "X-Application: <valid application string>")
whichStep = "Send Data"
oaXMLHTTP^send(msgStr) ; sync so it'll wait
resultXMLstr2 = oaXMLHTTP^responseText
isOK = true
endif
onFail
endTry
if not isOK then
errorShow(whichStep)
return
endif
resultXMLstr2.view("Returned") ; have to decode result from JSON
endMethod
Many thanks for any thoughts.
Comment