Skip to content

Commit

Permalink
Changed location of HTTP clients
Browse files Browse the repository at this point in the history
  • Loading branch information
atsansone committed Feb 9, 2024
1 parent 84aae01 commit 235e444
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
22 changes: 15 additions & 7 deletions src/content/tutorials/server/fetch-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ as well as Dart's JSON support in the [`dart:convert`][convert-docs] library
to fetch, decode, then use JSON-formatted data
retrieved from an HTTP server.

{{site.alert.secondary}}
Two other packages exist with platform-specific implementations for mobile.

* [cronet_http]({{site.pub-pkg}}/cronet_http)
provides access to the Android [Cronet][] HTTP client.
* [cupertino_http]({{site.pub-pkg}}/cupertino_http)
provides access to Apple's [Foundation URL Loading System][furl].

To learn more about their capabilities,
consult the package documentation.

{{site.alert.end}}

[Cronet]: {{site.android-dev}}guide/topics/connectivity/cronet/reference/org/chromium/net/package-summary
[furl]: {{site.apple-dev}}/documentation/foundation/url_loading_system
[JSON]: https://www.json.org/

## Background concepts
Expand Down Expand Up @@ -133,13 +148,6 @@ The `package:http` library provides a cross-platform solution
for making composable HTTP requests,
with optional fine-grained control.

:::note
You should avoid directly using `dart:io` or `dart:html`
to make HTTP requests.
Those libraries are platform-dependent
and tied to a single implementation.
:::

To add a dependency on `package:http`,
run the following [`dart pub add`][] command
from the top of your repo:
Expand Down
10 changes: 0 additions & 10 deletions src/content/tutorials/server/httpserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ prevpage:

Dart resources for writing HTTP servers include:

## Packages

* [cronet_http]({{site.pub-pkg}}/cronet_http)
Provides access to the Android [Cronet][] HTTP client.
* [cupertino_http]({{site.pub-pkg}}/cupertino_http)
Provides access to Apple's [Foundation URL Loading System][furl].

## Documentation

* [Using Google Cloud][] has information on Google Cloud products
Expand Down Expand Up @@ -44,6 +37,3 @@ Dart resources for writing HTTP servers include:
[simple-sample]: https://github.com/dart-lang/samples/tree/main/server/simple
[Using Google APIs]: /guides/google-apis
[Using Google Cloud]: /server/google-cloud

[Cronet]: {{site.android-dev}}guide/topics/connectivity/cronet/reference/org/chromium/net/package-summary
[furl]: {{site.apple-dev}}/documentation/foundation/url_loading_system

0 comments on commit 235e444

Please sign in to comment.