使用API将数据发送到Springboot服务器的最佳方法是什么?
我正在开发一个Flutter移动应用程序,我想知道将数据发送到Springboot服务器的最清洁方法。
I'm working on a flutter mobile app and I'm wondering about the cleanest way to send data to a springboot server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在这里,我们确实使用Flutter http package 以获取/使用来自API的数据。
这是一个例子
Here we do use flutter http package to obtain/ work with data from apis.
Here's an example
我不知道这是否是最干净的方式,但是您可以使用REST API从/将数据从/发送到SpringBoot服务器。
有关更多信息: https://medium.com/nerd-for-tech/flutter-series-connecting-ui-to-spring-boot-boot-backend-f9874dc3dcd5
用于扑朔迷离的项目结构,您可以使用bloc或bloc或任何其他国家管理。
I don't know whether it will be the cleanest way or not but you can use REST APIs to get/send data from/to Springboot Server.
For more information: https://medium.com/nerd-for-tech/flutter-series-connecting-ui-to-spring-boot-backend-f9874dc3dcd5
For your Flutter Project structure, you can use BLoC or any other state management.
您可以将Spring用作RESTAPI,它具有HTTP方法之类的逻辑(获取,发布,put,Delete ..)。
(使用RestFulapi很多原因,原因之一是用于各种客户端。(移动,Web,Pad,..))
您可以在URI,Header或Body中的查询字符串上将数据从客户端发送到服务器。
You can use spring as RestAPI which has logic something like http method(get, post, put, delete..).
(RestfulAPI is used many reason, one of reason is for various client.(mobile, web, pad,..))
You can send data from client to server on query string in uri, header or body.