http请求标头文本/普通颤音
如何使用标题文本/平原而不是应用程序/JSON进行HTTP请求。是否可以?我尝试了一些无法正确要求的方法。在Postman中,它正在工作。
代码 :
Map<String, dynamic> data = {"RequestdatagoeshereasObject"};
var uri = Uri.parse("MyURLgoeshere");
final response = await http.post( uri, body: data,headers: { "Content-Type": "text/plain",
"Accept": "*/*"});
How to http request with header text/plain instead of application/json. Is it possible? I have tried a few methods not been able to request them correctly. In postman, It is working.
Code :
Map<String, dynamic> data = {"RequestdatagoeshereasObject"};
var uri = Uri.parse("MyURLgoeshere");
final response = await http.post( uri, body: data,headers: { "Content-Type": "text/plain",
"Accept": "*/*"});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样做
Try by doing this