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

fix #1970 - make MultiPartFormDataContent open and exposed boundary #1984

Closed

Conversation

jschneidereit
Copy link
Contributor

Fixes #1970

Subsystem
Client

Motivation
Before this change MultiPartFormDataContent was not compatible with servers that accepted multipart/mixed content. By exposing boundary clients of ktor client can implement their own classes to override the content type boundary behavior like so:

class MultiPartMixedDataContent(
        parts: List<PartData>
) : MultiPartFormDataContent(parts) {
    override val contentType: ContentType = ContentType.MultiPart.Mixed.withParameter("boundary", boundary)
}

Solution
I made MultiPartFormDataContent an open class and exposed boundary to subclasses to allow for the above code snippet

@e5l e5l self-requested a review July 2, 2020 12:28
@jschneidereit
Copy link
Contributor Author

Hey there @e5l, any updates on this?

@jschneidereit jschneidereit deleted the jschneidereit/fix-1970 branch July 22, 2020 21:31
@jschneidereit jschneidereit restored the jschneidereit/fix-1970 branch July 22, 2020 21: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.

Objections to changing boundary to internal on MultiPartFormDataContent?
1 participant