Consider `ForwardingRequestBody`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 57/100
Research direction
Start by reading the RequestBody API and its existing subclasses to see how body behavior is exposed and forwarded. The issue proposes a ForwardingRequestBody that wraps a RequestBody and delegates its functions; check the related tests and add coverage showing the wrapper forwards the existing behavior. Done when callers can wrap a body without losing its behavior as the API evolves.
Written by the indexing model from the issue text.
Description
I want to change the Content-Type of a body, and so I'm wrapping it with my own RequestBody subclass. However, I'm not forced to forward isOneShot() or isDuplex() and so I didn't. Can I add those and forward them? Sure, but I'm also setting myself up for failure when another function is added in the future.
A ForwardingRequestBody which accepts a RequestBody and forwards all functions handles that for me. Further more, if new functions are added and OkHttp is upgraded my library inherits that behavior for free (without recompilation & release, too).
- Dominant language
- Kotlin
- Stars
- 47.1k
- Forks
- 9.3k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 24
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lysine-dev/okhttp
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lysine-dev/okhttp#9797 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lysine-dev/okhttp#9761 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lysine-dev/okhttp#9799 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
lysine-dev/okhttp#9796 ·
Maintainers usually reply within 1 day
-
Remove crossinline `addInterceptor` and `addNetworkInterceptor` overloadsMay be free again @Amir-Golmoradi claimed this 12 days ago, and no pull request is open. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 58/100
lysine-dev/okhttp#9779 · 1 comment ·
Maintainers usually reply within 1 day
All issues in lysine-dev/okhttp
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
navikt/mock-oauth2-server#1129 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
world-federation-of-advertisers/cross-media-measurement#4709 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mikepenz/AboutLibraries#1488 · 2 comments ·
Maintainers usually reply within 1 day