Skip to content

Add Ktor HTTP data source module#3071

Open
k88936 wants to merge 14 commits intoandroidx:mainfrom
k88936:feat/ktor-datasource
Open

Add Ktor HTTP data source module#3071
k88936 wants to merge 14 commits intoandroidx:mainfrom
k88936:feat/ktor-datasource

Conversation

@k88936
Copy link

@k88936 k88936 commented Feb 14, 2026

Summary

Introduce a new lib-datasource-ktor module similar to libraries/datasource_okhttp, providing KtorDataSource as an alternative HTTP data source implementation using Ktor client to solve issue #1646 .

What changed

  • impl: androidx.media3.datasource.DataSource using ktor
  • test: a unit test for DataSourceContractTest. and a unit test for it own.
  • api.txt in the repo root
  • some gradle config for include this module

Why

I recent met the same problem for maintaining both a okhttp client and a ktor client, similar to #1646 (comment)

Introduce a new lib-datasource-ktor module similar to `libraries/datasource_okhttp`.
 Providing KtorDataSource as an alternative HTTP data source implementation using Ktor client.
Copy link
Collaborator

@icbaker icbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a few commits, and added a few comments too

k88936 and others added 3 commits February 25, 2026 01:01
We can promote it to stable later
io.ktor.http.Headers it self is a case-insensitive map already
@k88936 k88936 force-pushed the feat/ktor-datasource branch from 44e93e3 to b51daad Compare February 24, 2026 17:40
This reverts commit b51daad.

fix: failed test case , we not only need a case-insensitively stored map,
 we also need a case-insensitively look up map.
@k88936 k88936 force-pushed the feat/ktor-datasource branch from 77621e9 to 8653e59 Compare February 25, 2026 03:30
@k88936 k88936 force-pushed the feat/ktor-datasource branch from c0f7038 to 919b31d Compare February 25, 2026 04:10
@k88936 k88936 requested a review from icbaker February 25, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants