You are reading a single comment by @rhb and its replies. Click here to read the full conversation.
  • Not sure where I'd stick that line into the code? It sounds like it isn't alternating though, is just always xml.

    Thanks though I'm learning some things this evening just not along the path I'd hoped to progress on.

  • The two lines I've given just replace the existing requests.get line. [EDIT] Copied the code from the wrong example so I've updated it now.

    The link to the alternating problem was to highlight that it "should" change its behaviour based on the value of the Accept header, albeit with some bug in the server's implementation.

    With no header provided (as your existing code does) it may default to XML.

    It may appear as JSON when viewed in the browser because the browser is providing the accept header set with it set to (amongst other things) application/json.

About

Avatar for rhb @rhb started