http_auth

Last updated:

0 purchases

http_auth Image
http_auth Images
Add to Cart

Description:

http auth

http_auth #
An http middleware for HTTP authentication (Basic/Digest).
The method (Basic or Digest) can optionally be autodetected.
Usage #
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');
}
copied to clipboard
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');
}
copied to clipboard
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');
}
copied to clipboard
Synchronous usage is also possible (see the example).

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.