我正在努力实现我可以在邮递员中完成的REPORT方法:
REPORT /remote.php/dav/files/UserName/ HTTP/1.1
Host: example.example.com.br
Authorization: Basic d3ByZW******ZWFubmV0
User-Agent: PostmanRuntime/7.17.1
Accept: */*
Cache-Control: no-cache
Postman-Token: 9c6c16ec-355a-408a-a5df-2095499ebfb9,1af9a0e6-641b-446a-9aa1-691ed79faa11
Host: example.example.com.br
Accept-Encoding: gzip, deflate
Content-Length: 0
Connection: keep-alive
cache-control: no-cache
<?xml version="1.0"?>
<oc:filter-files xmlns:d="DAV:" xmlns:oc="http://example.org/ns" xmlns:nc="http://example2.org/ns">
<oc:filter-rules>
<oc:favorite>1</oc:favorite>
</oc:filter-rules>
</oc:filter-files>
但是我不知道如何添加XML部分作为参数。我最接近的是Dio:
Dio dio = new Dio();
dio.options.method = 'REPORT';
dio.options.headers = {HttpHeaders.authorizationHeader: basicAuth};
Response response = await dio.request("$protocol://$baseUrl/$basePath/$us/");
在“ try / catch”块中进行测试时,返回以下内容: I / flutter(6407):DioError [DioErrorType.RESPONSE]:Http状态错误[500]
感谢您的帮助,谢谢。