Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Consider `ForwardingRequestBody`

Open
#9,800 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java, kotlin
Domain
api, backend

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lysine-dev/okhttp

All issues in lysine-dev/okhttp

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.