-
Notifications
You must be signed in to change notification settings - Fork 191
Write a Requests adapter #19
Comments
By the way, @michaelhelmick, you may end up wanting to keep an eye on this issue, I plan to play with Twython a bit here. |
👍 I'll help be a Guinea Pig :) just let me know if I can so anything. I need to get back to some open source stuff. Been keeping busy with work D: |
So mostly this is fine, except for the fact that Twython relies on urllib3's transparent content decoding, which |
Tracking that issue in #20. |
Current draft adapter is on the |
@Lukasa with the integration test fixtures? |
That might be the way to go. |
Alright, the adapter got checked in as part of 799e37e. It's been enhanced a few times since as well. @michaelhelmick, if you want to start messing about with it go ahead. I've confirmed in a quick local test file that it works in the basic case, as you can see below. Note that you'll need to install from hyper.contrib import HTTP20Adapter
from twython import Twython
API_KEY = ...
API_SECRET = ...
ACCESS_TOKEN = ..
ACCESS_SECRET = ...
t = Twython(API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_SECRET)
a = HTTP20Adapter()
t.client.mount('https://www.twitter.com', a)
t.client.mount('https://twitter.com', a)
t.client.mount('https://api.twitter.com', a)
print(t.search(q='python')) |
You can now get the Transport Adapter in v0.0.2 from PyPI. =) |
I replied via email, but it never sent I guess.. haha.
|
Just an update, I got sick from moving our office this past week (with rain and dust and everything) and didn't feel up to testing this. I'll try to test some stuff by mid-net week! Sorry!! |
That's not a problem at all @michaelhelmick, there's no rush here. I'm doing some basic performance analysis today anyway. =) |
With that said, I'm getting some insane numbers that don't make any sense to me. It seems that, in HTTP/1.1, we're receiving ten times as much data as we are in HTTP/2.0. I have a question: does |
As a shorter-term goal than getting into urllib3 (tracked by #18), let's try to get
hyper
some exposure by making it plug into Requests. This should lead to some really interesting experiments, e.g. running Twython over HTTP/2.0.The text was updated successfully, but these errors were encountered: