コード例 #1
0
 def posthandler(*args, **kwargs):
     request = kwargs['RequestURI']
     response = yield httppost('localhost', port, '/path', body, 
             headers={'Content-Type': 'text/plain'}
     )
     yield response
     done.append(response)
コード例 #2
0
 def _httppost(self, **kwargs):
     if self._synchronous:
         req = Request("http://%(host)s:%(port)s%(request)s" % kwargs, kwargs['body'])
         req.add_header('User-Agent', kwargs['headers']['User-Agent'])
         response = urlopen(req)
         raise StopIteration((str(response.getcode()), response.read()))
     response = yield httppost(**kwargs)
     raise StopIteration((response.split(CRLF * 2)))
コード例 #3
0
 def _httppost(self, **kwargs):
     if self._synchronous:
         req = Request("http://%(host)s:%(port)s%(request)s" % kwargs,
                       kwargs['body'])
         req.add_header('User-Agent', kwargs['headers']['User-Agent'])
         response = urlopen(req)
         return [dict(StatusCode=str(response.getcode())), response.read()]
     response = yield httppost(**kwargs)
     header, body = parseResponse(response)
     return [header, body]
コード例 #4
0
 def posthandler(*args, **kwargs):
     response = yield httppost('localhost', port, '/path', body)
     yield response
     responses.append(response)
コード例 #5
0
 def posthandler(*args, **kwargs):
     response = yield httppost('localhost', port, '/path', body)
     yield response
     responses.append(response)
コード例 #6
0
 def _httppost(self, **kwargs):
     return httppost(**kwargs)
コード例 #7
0
ファイル: solrinterface.py プロジェクト: seecr/meresco-solr
 def _httppost(self, **kwargs):
     return httppost(**kwargs)