Skip to content

Commit 36965a9

Browse files
authored
Pass URI instead of String in README (#535)
Fixes #533 Use Uri.Parse to match the implementation
1 parent 28f740c commit 36965a9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.13.1-dev
2+
13
## 0.13.0
24

35
* Stable null safety release.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ you to make individual HTTP requests with minimal hassle:
1515
```dart
1616
import 'package:http/http.dart' as http;
1717
18-
var url = 'https://example.com/whatsit/create';
18+
var url = Uri.parse('https://example.com/whatsit/create');
1919
var response = await http.post(url, body: {'name': 'doodle', 'color': 'blue'});
2020
print('Response status: ${response.statusCode}');
2121
print('Response body: ${response.body}');
@@ -30,7 +30,7 @@ If you do this, make sure to close the client when you're done:
3030
```dart
3131
var client = http.Client();
3232
try {
33-
var uriResponse = await client.post('https://example.com/whatsit/create',
33+
var uriResponse = await client.post(Uri.parse('https://example.com/whatsit/create'),
3434
body: {'name': 'doodle', 'color': 'blue'});
3535
print(await client.get(uriResponse.bodyFields['uri']));
3636
} finally {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: http
2-
version: 0.13.0
2+
version: 0.13.1-dev
33
homepage: https://github.com/dart-lang/http
44
description: A composable, multi-platform, Future-based API for HTTP requests.
55

0 commit comments

Comments
 (0)