Commits

Donald Stufft  committed 11977e6 Merge

Merge pull request #13 from rdegges/dev

Making ``Resource._request`` use HTTP accept header when making requests...

  • Participants
  • Parent commits 48127f4, a10f439

Comments (0)

Files changed (2)

File slumber/__init__.py

         if self._store["append_slash"] and not url.endswith("/"):
             url = url + "/"
 
-        resp = self._store["session"].request(method, url, data=data, params=params, headers={"content-type": s.get_content_type()})
+        resp = self._store["session"].request(method, url, data=data, params=params, headers={"content-type": s.get_content_type(), "accept": s.get_content_type()})
 
         if 400 <= resp.status_code <= 499:
             raise exceptions.HttpClientError("Client Error %s: %s" % (resp.status_code, url), response=resp, content=resp.content)

File tests/resource.py

             "http://example/api/v1/test",
             data=None,
             params=None,
-            headers={"content-type": self.base_resource.get_serializer().get_content_type()}
+            headers={"content-type": self.base_resource.get_serializer().get_content_type(), "accept": self.base_resource.get_serializer().get_content_type()}
         )