among xxx For custom class objects , call json.dumps I made a mistake .
How to solve it ? It's simple , Change the object to dict Structural transformation OK 了 !
Example : The object to be transferred is obj
convert = dict()
convert ['a'] = obj.a
convert ['b'] = obj.b
result = json.dumps(convert)
Common types to json The conversion rules are as follows :