OpenFeign / OpenFeign/feign

FeignClient not sending proper form url encoded request

Open
#1,602 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feedback provided
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

We have a scenario where a POST application/form-url-encoded request is to be sent to an API endpoint. And we are using @FeignClient annotated interface having a @PostMapping annotated function which takes in a POJO class as an argument such that the attributes of the class will be set as key value pairs of form data.

The issue is that the POJO class ( which is an argument to the function ) is derived from a base class. Due to which the form data posted to the API endpoint does not contain the attributes of the base class.

It works fine if the argument to @PostMapping function is a simple POJO class which doesn't extend any other class.

Can you please suggest a solution to the issue?

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the form-url-encoded POST through the @FeignClient and @PostMapping scenario described, comparing a simple POJO with one that extends a base class. Trace how the POJO is converted into form key-value pairs; done means inherited attributes are included in the request while existing simple-POJO behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.