engine.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:solaris-ips 作者: oracle 项目源码 文件源码
def send_data(self, url, data=None, header=None, sslcert=None,
            sslkey=None, repourl=None, ccancel=None,
            data_fobj=None, data_fp=None, failonerror=True,
            progclass=None, progtrack=None, proxy=None, runtime_proxy=None):
                """Invoke the engine to retrieve a single URL.
                This routine sends the data in data, and returns the
                server's response.

                Callers wishing to obtain multiple URLs at once should use
                addUrl() and run().

                sendData will return a read-only file object that allows access
                to the server's response.."""

                fobj = fileobj.StreamingFileObj(url, self, ccancel=ccancel)
                progfunc = None

                if ccancel and not progtrack and not progclass:
                        progfunc = fobj.get_progress_func()

                t = TransportRequest(url, writefunc=fobj.get_write_func(),
                    hdrfunc=fobj.get_header_func(), header=header, data=data,
                    httpmethod="POST", sslcert=sslcert, sslkey=sslkey,
                    repourl=repourl, progfunc=progfunc, uuid=fobj.uuid,
                    read_fobj=data_fobj, read_filepath=data_fp,
                    failonerror=failonerror, progclass=progclass,
                    progtrack=progtrack, proxy=proxy,
                    runtime_proxy=runtime_proxy)

                self.__req_q.appendleft(t)

                return fobj
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号