Skip to content

Provide a public API like RequestBody.Empty #8670

Closed
@MukjepScarlet

Description

@MukjepScarlet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions