【问题标题】:OAuth2 request with React Native使用 React Native 的 OAuth2 请求
【发布时间】:2016-05-25 15:31:34
【问题描述】:

我正在为我的移动应用程序使用 Yelp API。 Yelp API 需要 OAuth2 请求(消费者密钥、秘密密钥、令牌、秘密令牌)。如何使用 react native 发出请求?

【问题讨论】:

    标签: javascript oauth-2.0 react-native


    【解决方案1】:

    您可以使用 fetch api 发出网络请求, 参考http://facebook.github.io/react-native/releases/0.26/docs/tutorial.html#fetching-real-data

    请参阅 https://github.com/github/fetch 获取文档

      fetch(apiUrl, options)
      .then(function(response) {
        return response.json()
      }).then(function(json) {
        console.log('parsed json', json)
      }).catch(function(ex) {
        console.log('parsing failed', ex)
      })
    

    【讨论】:

    • 这只是一个简单的fetch请求,oauth部分在哪里?
    猜你喜欢
    • 2018-05-05
    • 2019-07-24
    • 2022-12-17
    • 2014-10-11
    • 2019-05-24
    • 2020-07-29
    • 2016-01-11
    • 1970-01-01
    • 2017-10-05
    相关资源
    最近更新 更多