淘宝联盟超级搜索接口
It’s been a few months since I last spoke about hyper
. The reason I’ve been so quiet is primarily because not much progress has been made on the project. I’ve been swamped with other projects (most notably Project Calico), and that’s limited my ability to make much forward progress.
自从我上次谈到hyper
以来已经有几个月了。 我这么安静的原因主要是因为该项目没有取得太大进展。 我忙于其他项目(最著名的是Calico项目 ),这限制了我取得更大进步的能力。
However, in the last few weeks there’s been a bit more activity on hyper
, in large part due to the excellent work of Tetsuya Morimoto, who has provided a couple of desperately needed bug fixes. If you don’t want to read the rest of this post and just want the goodness, you can download v0.2.0 of hyper
from PyPI right now. Go get it!
但是,在过去的几周中,关于hyper
活动有所增加,这在很大程度上是由于森本哲也的出色工作,他提供了许多急需的错误修复。 如果您不想阅读本文的其余部分,而只是想了解它的好处,可以立即从PyPI下载hyper
v0.2.0。 去实现它(梦想);去得到它(东西!
In addition to those bug fixes, however, he provided the impetus for the most exciting new ‘feature’ of hyper
, which isn’t actually a feature of hyper
at all.
但是,除了这些错误修复之外,他还为hyper
的最令人兴奋的新“功能”提供了动力,而实际上这根本不是hyper
的功能。
重大新闻! (Big News!)
The highlight is this: as of today you can get the awesome HTTPie to issue requests over HTTP/2, using hyper
. This development takes advantage of HTTPie’s very cool plugin architecture to allow for all HTTPS requests to be sent over HTTP/2 instead.
重点是: 从今天起,您可以使用hyper
来获得出色的HTTPie通过HTTP / 2发出请求 。 此开发利用了HTTPie非常酷的插件体系结构,允许所有HTTPS请求改为通过HTTP / 2发送。
Here’s an example:
这是一个例子:
lukasa@mbp:hyper/ % http https://nghttp2.org/httpbin/get HTTP/2.0 200 access-control-allow-credentials: true access-control-allow-origin: * content-length: 271 content-type: application/json date: Sat, 07 Feb 2015 12:57:57 GMT server: nghttpx nghttp2/0.7.4-DEV strict-transport-security: max-age=31536000 via: 1.1 nghttpx { "args": {}, "headers": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "close", "Host": "httpbin", "User-Agent": "HTTPie/1.0.0-dev", "Via": "2.0 nghttpx" }, "origin": "81.156.148.41", "url": "https://httpbin/get" }
lukasa@mbp:hyper/ % http https://nghttp2.org/httpbin/get HTTP/2.0 200 access-control-allow-credentials: true access-control-allow-origin: * content-length: 271 content-type: application/json date: Sat, 07 Feb 2015 12:57:57 GMT server: nghttpx nghttp2/0.7.4-DEV strict-transport-security: max-age=31536000 via: 1.1 nghttpx { "args": {}, "headers": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "close", "Host": "httpbin", "User-Agent": "HTTPie/1.0.0-dev", "Via": "2.0 nghttpx" }, "origin": "81.156.148.41", "url": "https://httpbin/get" }
Notice the HTTP/2.0 return code, and the fact that this request went to a copy of httpbin that runs behind the nghttp2 HTTP/2 server.
请注意HTTP / 2.0返回代码,以及该请求到达了nghttp2 HTTP / 2服务器后面运行的httpbin副本的事实 。
This is hugely exciting. The above very simple web requests represents a great bit of collaborative open-source effort, involving the following tools:
这非常令人兴奋。 上面非常简单的Web请求代表了很多协作的开源工作,其中涉及以下工具:
I’d like to thank the contributors and maintainers of all those tools for this enormously exciting moment. hyper
required relatively little work to slot in to HTTPie, which is a testament both to HTTPie and to hyper
.
在此非常激动人心的时刻,我要感谢所有这些工具的贡献者和维护者。 hyper
只需很少的工作就可以插入HTTPie,这对HTTPie和hyper
都证明了这一点。
If you want to try this out, you can follow the instructions on this page to get going. Note that you should definitely play around with this in a virtual environment, as it’ll break any HTTPS-encrypted HTTP/1.1 connections you want to make. Best not to break your normal HTTPie install!
如果您想尝试一下,可以按照此页面上的说明进行操作。 请注意,您绝对应该在虚拟环境中解决此问题,因为它会破坏您要建立的任何HTTPS加密的HTTP / 1.1连接。 最好不要破坏您的常规HTTPie安装!
更多大新闻 (More Big News)
The other big news is that hyper
now supports Python 2.7.9! Thanks to the work done backporting the ssl
module to Python 2.7 (PEP 466), the Python 2.7.9 ssl
module is good enough to do HTTP/2. This means that Python 2.7.9 is no longer blocked behind the development-hell-ridden pyOpenSSL module.
另一个大新闻是, hyper
现在支持Python 2.7.9! 由于完成了将ssl
模块回移植到Python 2.7( PEP 466 )的工作,Python 2.7.9 ssl
模块足以执行HTTP / 2。 这意味着Python 2.7.9不再在开发难缠的pyOpenSSL模块之后被阻止。
So now those of you stuck on Python 2.7 can use HTTP/2 as well! The above HTTPie news applies just as well on Python 2.7.9 as on Python 3.4.
因此,现在困扰于Python 2.7的人也可以使用HTTP / 2! 上面的HTTPie新闻在Python 2.7.9和Python 3.4上同样适用。
激动人心的时代! (Exciting Times!)
翻译自: https://www.pybloggers.com/2015/02/hyper-the-state-of-the-union/
淘宝联盟超级搜索接口