execution.py 文件源码

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

项目:http-prompt 作者: eliangcs 项目源码 文件源码
def _call_httpie_main(self):
        context = self._final_context()
        args = extract_args_for_httpie_main(context, self.method)
        env = Environment(stdout=self.output, stdin=sys.stdin,
                          is_windows=False)
        env.stdout_isatty = self.output.isatty()
        env.stdin_isatty = sys.stdin.isatty()

        # XXX: httpie_main() doesn't provide an API for us to get the
        # HTTP response object, so we use this super dirty hack -
        # sys.settrace() to intercept get_response() that is called in
        # httpie_main() internally. The HTTP response intercepted is
        # assigned to self.last_response, which self.listener may be
        # interested in.
        sys.settrace(self._trace_get_response)
        try:
            httpie_main(args, env=env)
        finally:
            sys.settrace(None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号