Groups
Groups
Sign in
Groups
Groups
jsOAuth
Conversations
About
Send feedback
Help
xhr version/package to use jsOAuth with node.js
58 views
Skip to first unread message
S James
unread,
Jul 16, 2012, 5:52:30 PM
7/16/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jso...@googlegroups.com
Hi folks,
I'm trying to use jsOAuth in node.js. Right now I'm stumbling around line 810 of jsOAuth-1.3.4.js:
/**
* Factory object for XMLHttpRequest
*/
function Request() {
var XHR;
if (typeof global.Titanium !== 'undefined' && typeof global.Titanium.Network.createHTTPClient != 'undefined') {
XHR = global.Titanium.Network.createHTTPClient();
} else if (typeof require !== 'undefined') {
// CommonJS require
try {
XHR = new require('xhr').XMLHttpRequest();
} catch (e) {
[snip rest]
I'm not sure which node.js package to "require". The one installed by "npm install xhr" doesn't seem to have quite the right API.
Can anyone help here?
Many thanks in advance,
Seb James
Rob Griffiths
unread,
Jul 17, 2012, 4:09:14 AM
7/17/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jso...@googlegroups.com
Hi Seb,
I think xhr has gone away. The one I've been using lately is w3c-xmlhttprequest
You can replace the line XHR = new require('xhr').XMLHttpRequest(); with XHR = new require('w3c-xmlhttprequest').XMLHttpRequest();
--
Rob Griffiths
Sent with
Sparrow
Reply all
Reply to author
Forward
0 new messages