Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a public API like RequestBody.Empty #8670

Open
MukjepScarlet opened this issue Feb 6, 2025 · 0 comments
Open

Provide a public API like RequestBody.Empty #8670

MukjepScarlet opened this issue Feb 6, 2025 · 0 comments
Labels
enhancement Feature not a bug

Comments

@MukjepScarlet
Copy link

I'm using version 5.0.0-alpha14, and found that we have a public commonEmptyRequestBody in -UtilCommon.kt.

val commonEmptyHeaders: Headers = Headers.headersOf()
val commonEmptyRequestBody: RequestBody = EMPTY_BYTE_ARRAY.toRequestBody()
val commonEmptyResponse: ResponseBody = EMPTY_BYTE_ARRAY.toResponseBody()

I think we can have them internal and public them like this:

// with @JvmField

Headers.Empty
RequestBody.Empty
ResponseBody.Empty

This type might fit Kotlin more. Also we can easier access them in Java like Headers.Companion.Empty

@MukjepScarlet MukjepScarlet added the enhancement Feature not a bug label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature not a bug
Projects
None yet
Development

No branches or pull requests

1 participant