mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Use rhttp to make webdav requests.
This commit is contained in:
@@ -257,18 +257,7 @@ class RHttpAdapter implements HttpClientAdapter {
|
||||
Future<void>? cancelFuture,
|
||||
) async {
|
||||
var res = await rhttp.Rhttp.request(
|
||||
method: switch (options.method) {
|
||||
'GET' => rhttp.HttpMethod.get,
|
||||
'POST' => rhttp.HttpMethod.post,
|
||||
'PUT' => rhttp.HttpMethod.put,
|
||||
'PATCH' => rhttp.HttpMethod.patch,
|
||||
'DELETE' => rhttp.HttpMethod.delete,
|
||||
'HEAD' => rhttp.HttpMethod.head,
|
||||
'OPTIONS' => rhttp.HttpMethod.options,
|
||||
'TRACE' => rhttp.HttpMethod.trace,
|
||||
'CONNECT' => rhttp.HttpMethod.connect,
|
||||
_ => throw ArgumentError('Unsupported method: ${options.method}'),
|
||||
},
|
||||
method: rhttp.HttpMethod(options.method),
|
||||
url: options.uri.toString(),
|
||||
settings: settings,
|
||||
expectBody: rhttp.HttpExpectBody.stream,
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import 'package:dio/io.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:venera/foundation/app.dart';
|
||||
import 'package:venera/foundation/appdata.dart';
|
||||
@@ -90,18 +89,11 @@ class DataSync with ChangeNotifier {
|
||||
String user = config[1];
|
||||
String pass = config[2];
|
||||
|
||||
var proxy = await AppDio.getProxy();
|
||||
|
||||
var client = newClient(
|
||||
url,
|
||||
user: user,
|
||||
password: pass,
|
||||
adapter: IOHttpClientAdapter(
|
||||
createHttpClient: () {
|
||||
return HttpClient()
|
||||
..findProxy = (uri) => proxy == null ? "DIRECT" : "PROXY $proxy";
|
||||
},
|
||||
),
|
||||
adapter: RHttpAdapter(),
|
||||
);
|
||||
|
||||
try {
|
||||
@@ -162,18 +154,11 @@ class DataSync with ChangeNotifier {
|
||||
String user = config[1];
|
||||
String pass = config[2];
|
||||
|
||||
var proxy = await AppDio.getProxy();
|
||||
|
||||
var client = newClient(
|
||||
url,
|
||||
user: user,
|
||||
password: pass,
|
||||
adapter: IOHttpClientAdapter(
|
||||
createHttpClient: () {
|
||||
return HttpClient()
|
||||
..findProxy = (uri) => proxy == null ? "DIRECT" : "PROXY $proxy";
|
||||
},
|
||||
),
|
||||
adapter: RHttpAdapter(),
|
||||
);
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user