(self, url, data, **kwargs)
| 287 | return response.text |
| 288 | |
| 289 | def _post_json(self, url, data, **kwargs): |
| 290 | # Go <1.1 can't unserialize null to a string |
| 291 | # so we do this disgusting thing here. |
| 292 | data2 = {} |
| 293 | if data is not None and isinstance(data, dict): |
| 294 | for k, v in iter(data.items()): |
| 295 | if v is not None: |
| 296 | data2[k] = v |
| 297 | elif data is not None: |
| 298 | data2 = data |
| 299 | |
| 300 | if 'headers' not in kwargs: |
| 301 | kwargs['headers'] = {} |
| 302 | kwargs['headers']['Content-Type'] = 'application/json' |
| 303 | return self._post(url, data=json.dumps(data2), **kwargs) |
| 304 | |
| 305 | def _attach_params(self, override=None): |
| 306 | return override or { |
no test coverage detected