Comments (11)
Hi Marc,
I see no reason why XML should be an issue. the call back returns an object with a text property which you can then send into a XML parser or document fragment if you have a DOM around.
Clearly you'll want to avoid the *JSON methods.
Rob
Rob Griffiths
Twitter: @bytespider
Github: https://github.com/bytespider
bytespider.euSent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Friday, 23 September 2011 at 15:23, Marc Stalfoort wrote:
I'm testing with this library, which I like, but I' m running into issues whereas the service I'm trying to access sends XML responses to me. Is this library capable of handling XML responses or should this be implemented?
Reply to this email directly or view it on GitHub:
#21
from jsoauth.
That would be awesome
Can you supply me an example on how I would act on XML responses?
from jsoauth.
If you're wanting to work with JSON but the stream is in XML try https://github.com/bytespider/XML2JSON/blob/master/xml2json.js
It may not work with webkit, I've not updated it in a while. I'll try write up an example later today.
from jsoauth.
Looking forward to your example.
The situation as I have it now is: I'm performing a fetchRequestToken and the response I get is in XML.
In this method there is the following line "var token = oauth.parseTokenRequest(data.text);" which doesn't correctly convert the response so the oauth_token && oauth_token_secret properties on this object aren't set properly.
Therefor the "oauth.setAccessToken([token.oauth_token, token.oauth_token_secret])" gets rejected eventually from the service I'm connecting to.
I hope this is enough info for you to setup an example.
from jsoauth.
Okay this is definitely an area where i'll need to write a patch as currently the code assumes that the response for Token requests is a query string.
Your the first where the response is XML.
from jsoauth.
Can you provide example of the response?
from jsoauth.
this is 1 option:
< oauth type="request" > < token > udsfiusdf789HJAdsUYUI < / token > < secret > 76er78dyyufbYBFGJH < / secret > < / oauth >
from jsoauth.
this is another option:
< oauth type="request" >
\t < token > udsfiusdf789HJAdsUYUI < / token >
\t < secret > 76er78dyyufbYBFGJH < / secret >
< / oauth >
from jsoauth.
Hi Marc
Could you try out this version http://cl.ly/AQV5
from jsoauth.
Hey Rob
I finally managed to get working with the version you setup for me, thanks for that, and at first it wasn't completely working for me so I extended your class to my needs.
Still it's a good starting point and if you're interested on what exactly I did to fit it to my needs please let me know.
I'm not sending a pull request at the moment because I'm not sure at this point in the extension I did does comply to Oauth spec in XML mode, so I have to check this first.
from jsoauth.
Mark, any info on how you used the library is always handy for future development.
from jsoauth.
Related Issues (20)
- OAuth 2.0 Support HOT 11
- postJSON - Content-Type: 'application/json' HOT 4
- Support streaming responses HOT 11
- No request token error HOT 7
- jsOAuth and LinkedIn HOT 3
- Using requirejs breaks jsOAuth HOT 3
- encodable query params are double percent encoded HOT 2
- QueryString.setQueryParams doesn't decode query values HOT 3
- 1.3.6 error HOT 1
- Uncaught ReferenceError: netscape is not defined HOT 3
- Making life simpler: Chrome iOS-Simulator App HOT 1
- Error auth Appelerator sdk version >=2
- Missing onerror callback for Titanium HTTPClient
- Unexpected OAuth.urlDecode behavior HOT 3
- urlEncode method does not encode the tab character
- jsOAuth - Backbone.js HOT 4
- Make package installable using bower HOT 3
- It's not possible to make GET requests with two query parameters having the same name HOT 3
- Twitter 401 Unauthorized for get/post methods after access_token is saved HOT 6
- phonegap error, netscape is not defined HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsoauth.