refactor _get, _post and _delete to use a common base method, _request
only send json data if there is any
make docstring for _set_attrs_to_values