You watched my almost successful presentation on putting things in BigFix with the REST API. Sometimes demos go a little sideways, but in this case it may benefit your use of the APIs in the end. The problem was a simple, one-character problem. In Python ‘’’ marks the beginning of a multi-line string constant that ends with another ‘’’.
That was my problem. There should have been a backslash after the open ‘’’ to prevent a newline being at the start of the string! BigFix doesn’t care about newlines anywhere else, but it expects the <?xml tag to be the very first thing it sees, or it is a malformed message. I’m not even sure when I deleted the backslash. Because I ran my demo the night before.
So, don’t let this bite you!
But I will share annotated python source THAT WORKS here and now. It contains a lot of comments explaining what went awry in the demo and offers more than one way to fix it.
Please do play with this code and feel free to ask me questions about it.