auth_header 3.0.1 copy "auth_header: ^3.0.1" to clipboard
auth_header: ^3.0.1 copied to clipboard

Utility library to parse and manipulate HTTP Authorisation header

example/auth_header_example.dart

// Copyright (c) 2016, Ravi Teja Gudapati. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'dart:io';
import 'package:auth_header/auth_header.dart';

main() {
  String header = "Basic something-something";
  AuthHeaders authHeader = AuthHeaders.fromHeaderStr(header);
  print(authHeader);

  AuthHeaderItem items = AuthHeaderItem('some-scheme', 'teja');
  String headerManipulated = AuthHeaders.addItemToHeaderStr(header, items);
  print(headerManipulated);

  headerManipulated =
      AuthHeaders.removeSchemeFromHeaderStr(header, items.authScheme);
  print(headerManipulated);
}
2
likes
130
points
31.1k
downloads

Publisher

unverified uploader

Weekly Downloads

Utility library to parse and manipulate HTTP Authorisation header

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on auth_header