jiffy sun - 2018-03-15

Hi, I use Http service to get json content to config our test param, I have geted the content from our system. But I can not parse the content. this is my STAX script:

        <stafcmd name="'HttpTaskSearch'">
            <location>'local'</location>
            <service>'http'</service>
            <request>taskSearchRequest</request>
        </stafcmd>

        <message log="1">'HttpTaskSearch RC=%s, STAFResult=%s' % (RC, STAFResult)</message>

        <if expr="RC!= 0">
            <return>[RC, STAFResult]</return>
        </if>

        <script>    
            notFound = 'Can not found %s' % serialNo
            content = STAFResult['content'].encode('UTF8') 
        </script>

        <message log="1">'content : %s' % (content)</message>

        <if expr="content == None">
            <return>[5004,  notFound]</return>
        </if>

        <script>
            mc = STAFMarshalling.unmarshall(STAFResult['content'].encode('UTF8'))
            retdata = mc.getRootObject()
            taskInstance = retdata['taskInstance']      
        </script>

This is the log from STAX Monitor:
20180315-10:08:07 Info HttpTaskSearch RC=0, STAFResult={u'headers': None, u'statusMessage': u'', u'content': u'{"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}', 'staf-map-class-name': u'STAF/Service/HTTP/HttpResult', u'statusCode': u'200'}

20180315-10:08:07 Info content : {"taskInstance":{"id":1,"inventory":{"id":1},"macAddress":null,"serialNo":"12345678","status":"primary","tests":[{"id":1}],"uuid":"1db3883b-3bb0-43a6-aaca-daf57c4d3c40"}}


Since the content returned from the http service is unicode, I call encode('UTF8') , I use STAFMarshalling.isMarshalledData which return is false, I can not unmarshall the content. so my question is how to parse the content? Thanks very much!