v1.0.5
http_auth
HTTP Basic および Digest 認証用の Dart http ミドルウェア
38いいね 666030日間ダウンロード160Pub ポイント
AndroidiOSWebmacOSWindowsLinux
HTTP 認証(Basic/Digest)用の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).