is ```body``` not a dict? If it is a dict, then the ```AttribueError``` will never be raised.