简体   繁体   English

如何将React Native与Dreamfactory REST API集成在一起?

[英]How to integrate React Native with Dreamfactory REST API?

I am making a React Native app that must fetch data from an SQL Server. 我正在制作一个必须从SQL Server提取数据的React Native应用程序。 I'll be doing many complicated joins and other SQL functions so I figured DreamFactory would be easier to use in this way. 我将进行许多复杂的联接和其他SQL函数,因此我认为DreamFactory将更易于使用。

DreamFactory is a RESI API automation platform for SQL or NoSQL databases that automatically generates APIs for Swift, JavaScript, Ionic, React, and more. DreamFactory是用于SQL或NoSQL数据库的RESI API自动化平台,可自动为Swift,JavaScript,Ionic,React等生成API。

I found the DreamFactory SDK for React.js here: https://github.com/dreamfactorysoftware/reactjs-sdk 我在这里找到了React.js的DreamFactory SDK: https//github.com/dreamfactorysoftware/reactjs-sdk

However, does this mean it's going to work with React Native too? 但是,这是否意味着它也可以与React Native一起使用?

Well, is a REST API so it should work with a couple of tweaks. 好吧,这是一个REST API,因此应该可以进行一些调整。 Some of the examples are using $.ajax which I dont believe you have in RN, but you have fetch which you can use for something similar. 一些示例正在使用$ .ajax,我不相信您在RN中具有该功能,但是您可以将其用于类似的操作。

I actually use fetch to call many REST APIs so you should be fine. 我实际上使用fetch来调用许多REST API,所以应该没问题。 I personally use the JS client first and if it does not work at first try, make a wrapper of my own against the REST API. 我个人首先使用JS客户端,如果初次尝试不起作用,请针对REST API自行包装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM