authorization_header

Creator: coderz1093

Last updated:

0 purchases

authorization_header Image
authorization_header Images

Languages

Categories

Add to Cart

Description:

authorization header

A most easily usable authorization header management library in Dart!






1. About

1.1. Supported

1.1.1. Authorization Header
1.1.2. Authorization Type


1.2. Introduction

1.2.1. Install Library
1.2.2. Import It
1.2.3. Use AuthorizationHeader


1.3. License
1.4. More Information




1. About #
AuthorizationHeader is an open-sourced Dart library.
With AuthorizationHeader, you can easily manage authorization header on your application.
The AuthorizationHeader library provides a common features for generating authorization header for use with Basic or Bearer authorization. Proxy-Authorization for proxies is also supported.
By using the AuthorizationHeader library, there is no need for redundant implementation or research to generate the authorization header anymore!
1.1. Supported #
1.1.1. Authorization Header #



Name




Authorization


Proxy-Authorization



1.1.2. Authorization Type #



Name
RFC




Basic
RFC 7617


Bearer
RFC 6750



1.2. Introduction #
1.2.1. Install Library #
With Dart:
dart pub add authorization_header
copied to clipboard
With Flutter:
flutter pub add authorization_header
copied to clipboard
1.2.2. Import It #
import 'package:authorization_header/authorization_header.dart';
copied to clipboard
1.2.3. Use AuthorizationHeader #
AuthorizationHeader can be used in conjunction with the http package as follows.
import 'package:authorization_header/authorization_header.dart';
import 'package:http/http.dart' as http;

void main() async {
/// You can switch between Default and Proxy in the constructor.
final authHeader = Auth.of().bearer(token: 'test_token');
final proxyAuthHeader = Auth.ofProxy().bearer(token: 'test_token');

print(authHeader); // -> name: Authorization, value: Bearer test
print(proxyAuthHeader); // -> name: Proxy-Authorization, value: Bearer test

await http.post(
Uri.parse('https://test.com'),
headers: {
authHeader.name: authHeader.value,
proxyAuthHeader.name: proxyAuthHeader.value,
},
);
}
copied to clipboard
1.3. License #
Copyright (c) 2021, Kato Shinya. All rights reserved.
Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
copied to clipboard
1.4. More Information #
AuthorizationHeader was designed and implemented by Kato Shinya.

Creator Profile
License
API Document
Release Note
Bug Report

License

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

Files In This Product:

Customer Reviews

There are no reviews.