Announcement

Collapse
No announcement yet.

Why does KeepAlive return contenttype image/png ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why does KeepAlive return contenttype image/png ?

    I am just implementing my login procedure with a keepalive request every 6 minutes (just to be sure, to be sure..) and I just noticed in my debug that the generic HTTP wrapper method I use to make all POST/GET requests is returning a contentType of image/png when I make a keepalive request.

    Is there a reason for this?

    Login / LogOut return

    response.ContentType = text/html;charset=UTF-8

    whilst keep alive returns

    response.ContentType = image/png

    Same code different URL but same post parameters.

    No major, just wondering why!

    Thanks

  • #2
    keepAlive implementation in interactive login is rather weird. Just go there https://identitysso.betfair.com/api/keepAlive and it will return an empty 1x1 png (69 bytes). No any session extended, I didn't send any cookies.

    If I send ssoid cookie - the result is the same. Was the session extended or not? I call the API and I cannot distinguish between success and failure. The keepAlive is a bad work, API should always indicate at least success or failure but not just return a weird single pixel.

    I understand that the stupid applications can insert the image tag with address https://identitysso.betfair.com/api/keepAlive every 5 minutes and do not care about checking the answer, but that's certainly the ugly stuff
    Betfair Bots Made Easy
    https://github.com/AlgoTrader/betfair

    Comment


    • #3
      Yes there are a lot of "weird" things about the new API I don't really like or understand. I don't suppose you know how I can get the last lay AND last back price traded for a single selection? In the old system you could but in the new system the last traded price is above the best lay/back prices so I have no idea if it was the last lay or back price but what I really want is BOTH. So a call to my get latest price method would return an object for the selection with the best lay, best back, last traded back and last traded lay price. Can you think of a way to get that info in the new system?

      Comment


      • #4
        lastPriceTraded is neither back or lay. It means that someone got his back matched and someone got lay matched. It means just that, there is no info who was waiting and who got the bet matched immediatly.

        "last traded back and last traded lay price" is a complete bullshit. They are always THE SAME. If Mr.Smith had his back matched, then Mr.Black had his lay matched exactly in the same moment. Match always DUAL, there is no back match or lay match, there is just match
        Betfair Bots Made Easy
        https://github.com/AlgoTrader/betfair

        Comment


        • #5
          In the old system when I went to get a price (lay or back) for a selection, say I was betting on a runner and I wanted the last price I called a function that would try and get the best price to go for. However as a lot of the time there were no lay prices to take (plus I tried to limit the prices to sensible prices e.g < 100/200 whatever) I would default the price to the last taken lay price so that if I couldn't obtain a current best price I would (hopefully) still have the last price laid or backed for that runner depending on if I was placing a lay or back price.

          Therefore as the function was not getting BOTH prices as the same time just the price I wanted for the bettype I wanted to return a value. OF course I could change the code.

          Comment


          • #6
            But...

            But as you seem to be an expert on the new system can you tell me how I can change the API_ING C# example I downloaded from the example code site so that the marketCatalogue class returns the RUNNER_METADATA?

            The code in the class isn't even trying to return this data, I have changed their calling function so the enum is passed through but I cannot get any of the objects or variables to access the meta data so I can return it in a format for me to use.

            I know people keep giving me REST examples but I want to know what object I need to use and which code to extend to access this data.

            So far no-one can tell me how to do this in C# (BDP inc) and as I am using their own API_ING example codebase to work from I need some help getting this data so I don't have to continue scraping racing sites to get it. Even an example in VB.net or C++ would do.

            Any ideas? The thread is here >> https://forum.bdp.betfair.com/showth...ted=1#post8432

            Thanks

            Comment


            • #7
              Slightly less off-topic

              How long is it before sessions ACTUALLY die without a KeepAlive? Webpage sessions last hours or days with the client computer asleep (thus definitely no KeepAlives from the browser). Is it different for API sessions?

              Comment


              • #8
                Originally posted by monkeymagix View Post
                I am just implementing my login procedure with a keepalive request every 6 minutes (just to be sure, to be sure..) and I just noticed in my debug that the generic HTTP wrapper method I use to make all POST/GET requests is returning a contentType of image/png when I make a keepalive request.

                Is there a reason for this?

                Login / LogOut return

                response.ContentType = text/html;charset=UTF-8

                whilst keep alive returns

                response.ContentType = image/png

                Same code different URL but same post parameters.

                No major, just wondering why!

                Thanks
                If image returned, it means you didn't specify Accept: json (check documentation)

                Originally posted by sun View Post
                How long is it before sessions ACTUALLY die without a KeepAlive? Webpage sessions last hours or days with the client computer asleep (thus definitely no KeepAlives from the browser). Is it different for API sessions?
                It is 12 hours (20 min for Italian), check documentation

                Comment

                Working...
                X