-
Notifications
You must be signed in to change notification settings - Fork 108
Support streaming responses #29
Comments
To clarify my use-case even more: I would like to listen to readystate == 3, and read the partial response from xhr.responseText. This does not work in IE, so I don't expect support for this in jsOAuth. What I would like, is a way to write the plumbing for that myself, and somehow just use the OAuth signing from jsOAuth. |
How about something like: var xhr = oauth.signedXMLHttpRequest({
method: "GET",
url: "http://bytespider.eu",
data: {message: "this is cool"},
headers: {"Content-Type": "application/x-www-form-urlencoded"}
}); Clearly this method you'd have to handle some stuff yourself like how to encode any data you need to send. Alternatively: |
Yes, the first alternative sounds like a great one! |
Here's a working example of what I'm trying to do: http://stackoverflow.com/a/8752044/117268 - I just need OAuth instead of Basic Auth now. |
Hello guy, I have made the oauth work with streaming twitter. It is mostly working from the origin but there were some problems. I had to remove the header callback, since keys were not well calculated. headerParams = { As, you said I had to manage the stream away from this condition : |
I'm sorry I don't understand. Can you be clearer? Please submit a pull request if you have code you would like to share. |
+1 vote for this as well - I asked this question prior to finding this issue: http://stackoverflow.com/questions/11374771/how-to-make-twitter-streaming-apis-work-with-jsoauth |
jsOAuth 2.0 will support a way to craft and use your own XHR objects and callbacks. |
@bytespider Thanks for the update - looking forward to 2.0! |
Sadly not. I may do a pre-release without OAuth 2.0 support just to get the code out there. |
@bytespider Yeah that pre-release sounds like a great idea! |
A feature request: I'm playing with Twitter's Streaming API, which
requires OAuth for connecting. Problem is jsOAuth does not support
streaming responses.
The get method currently looks at readystate == 4, which is the
completed state. A streaming response never does complete. So I need to
write my own request method, that does that magic I want. Problem is,
the request method is HUGE, and while I only need to monkey patch a
small part of the code, the size of the request method makes me have to
copy/paste large chunks of code. So it all sums up to this: I would like
request method to be split up into several smaller methods, so I can
write a method that works with streaming.
The text was updated successfully, but these errors were encountered: