예제 #1
0
 def test_put_request(self):
     req = PutRequest("http://example.com/")
     req.data('{"test":"best"}', "application/json")
     real = req._request()
     self.assertEqual(real.get_data(), '{"test":"best"}')
     self.assertEqual(real.get_method(), "PUT")
예제 #2
0
파일: queue.py 프로젝트: NORDUnet/niscanner
 def _put(self,item):
     put_url = urljoin(self.url, item["resource_uri"])
     req = PutRequest(put_url)
     req.data(json.dumps(item), "application/json")
     req.header("Authorization", self.api_auth)
     req.put()