Skip to content

Commit 067bff3

Browse files
Create java http package (#971)
1 parent ff1fcfe commit 067bff3

File tree

8 files changed

+119
-0
lines changed

8 files changed

+119
-0
lines changed

pkgs/java_http/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
- Initial development release.

pkgs/java_http/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2023, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkgs/java_http/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
A Dart package for making HTTP requests using native Java APIs
2+
([java.net.HttpURLConnection](https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html)).
3+
4+
Using native Java APIs has several advantages on Android:
5+
6+
* Support for `KeyStore` `PrivateKey`s ([#50669](https://github.com/dart-lang/sdk/issues/50669))
7+
* Support for the system proxy ([#50434](https://github.com/dart-lang/sdk/issues/50434))
8+
* Support for user-installed certificates ([#50435](https://github.com/dart-lang/sdk/issues/50435))
9+
10+
## Status: Experimental
11+
12+
**NOTE**: This package is currently experimental and published under the
13+
[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to
14+
solicit feedback.
15+
16+
For packages in the labs.dart.dev publisher we generally plan to either graduate
17+
the package into a supported publisher (dart.dev, tools.dart.dev) after a period
18+
of feedback and iteration, or discontinue the package. These packages have a
19+
much higher expected rate of API and breaking changes.
20+
21+
Your feedback is valuable and will help us evolve this package.
22+
For general feedback and suggestions please comment in the
23+
[feedback issue](https://github.com/dart-lang/http/issues/764).
24+
For bugs, please file an issue in the
25+
[bug tracker](https://github.com/dart-lang/http/issues).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// This code was generated by the Dart create command with the package template.
6+
7+
import 'package:java_http/java_http.dart';
8+
9+
void main() {
10+
var awesome = Awesome();
11+
print('awesome: ${awesome.isAwesome}');
12+
}

pkgs/java_http/lib/java_http.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library;
6+
7+
export 'src/java_http_base.dart';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// This code was generated by the Dart create command with the package template.
6+
7+
class Awesome {
8+
bool get isAwesome => true;
9+
}

pkgs/java_http/pubspec.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: java_http
2+
description: A Dart package for making HTTP requests using java.net.HttpURLConnection.
3+
version: 0.0.1
4+
repository: https://github.com/dart-lang/http/tree/master/pkgs/java_http
5+
publish_to: none
6+
7+
environment:
8+
sdk: ^3.0.0
9+
10+
dependencies:
11+
12+
dev_dependencies:
13+
lints: ^2.0.0
14+
test: ^1.21.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// This code was generated by the Dart create command with the package template.
6+
7+
import 'package:java_http/java_http.dart';
8+
import 'package:test/test.dart';
9+
10+
void main() {
11+
group('A group of tests', () {
12+
final awesome = Awesome();
13+
14+
setUp(() {
15+
// Additional setup goes here.
16+
});
17+
18+
test('First Test', () {
19+
expect(awesome.isAwesome, isTrue);
20+
});
21+
});
22+
}

0 commit comments

Comments
 (0)