I'm trying to save a form which involves an API call but its throwing me an error that 

> 
> Object of type 'bytes' is not JSON serializable.
> 
> 
> 

when I call data=json.dump(dump) it throws the following error

```
 def getAttributes(self, jsonObj=False):
        attributes = vars(self)
        data = {var: value for var, value in attributes.items() if not var.startswith('_')}
        print(data, "data")
        if jsonObj:
            import json
            data = json.dumps(data)

        return data

```

p.s.: In print data statement it is returning me a dict.