我需要编写带有标头和json主体的Post请求,如下所示;
Content-Type:application/json
Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9
{
"Data": {
"Permissions": [
"ReadAccountsDetail",
"ReadProducts",
"ReadStandingOrdersDetail",
"ReadTransactionsCredits",
"ReadTransactionsDebits",
"ReadTransactionsDetail",
"ReadPAN"
],
"ExpirationDateTime": "2019-06-29T00:00:00+00:00",
"TransactionFromDateTime": "2019-05-03T00:00:00+00:00",
"TransactionToDateTime": "2019-12-03T00:00:00+00:00"
},
"Risk": {}
}
答案 0 :(得分:0)
正如塞尔吉奥·伯纳尔(Sergio Bernal)所指出的,您应该在自己的pubspec.yaml中添加<button t-if="request.httprequest.url == '/shop'">Filters OFF</button>
<!--Since current_URL would be something like "/shop/category/laptops?filter=5-44" if there were any filters applied -->
<button t-else="">Filters ON</button>
:
http
然后按如下所示导入它:
dependencies:
...
http: any
将允许您使用以下方法:
import 'package:http/http.dart' as http;
这是您的示例:
http.post(dynamic url, {Map<String, String> headers, dynamic body, Encoding encoding})