v1.0.4
http_auth
Dart http 中間件,用於 HTTP Basic 和 Digest 認證
38喜歡 1.1萬近 30 天下載160Pub 分數
AndroidiOSWebmacOSWindowsLinux
一個用於 HTTP 認證(基本/摘要)的 Dart http 中間件
以下為英文專案原文快照,最新內容請造訪 GitHub。
An http middleware for HTTP authentication (Basic/Digest).
The method (Basic or Digest) can optionally be autodetected.
HTTP Basic authentication:
import 'package:http_auth/http_auth.dart';
main() async {
var client = http_auth.BasicAuthClient('user', 'passwd');
var response = client.get('http://httpbin.org/basic-auth/user/passwd');
}
HTTP Digest authentication:
import 'package:http_auth/http_auth.dart';
main() async {
var client = http_auth.DigestAuthClient('user', 'passwd');
var response = client.get('http://httpbin.org/digest-auth/auth/user/passwd');
}
Automatic detection of the protocol (Basic or Digest):
import 'package:http_auth/http_auth.dart';
main() async {
var client = http_auth.NegotiateAuthClient('user', 'passwd');
var response = client.get('http://httpbin.org/digest-auth/auth/user/passwd');
}
Synchronous usage is also possible (see the example).