[MGNLRESTCL-215] Rest client is sending empty body even when no body is defined in rest client definition Created: 27/Jun/23 Updated: 28/Jun/23 |
|
| Status: | Accepted |
| Project: | REST Client |
| Component/s: | None |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Raphael Falvo | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Epic Link: | RESTClient 2024 | ||||||||
| Team: | |||||||||
| Description |
|
Magnolia is sending body in request even when no body property is defined in rest client definition. Some APIs are not behaving properly when sending a GET with an empty body, especially when content type header is set to application/json.
We are facing this issue with BSI calls, please see below some samples : curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: text/plain' Then a GET with empty body, with header Content-Type set to text/plain, it still works curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: text/plain' \ --data ''
And now GET with empty body, with header Content-Type set to application/json, doesn’t work. This is basically how magnolia rest client is sending the request. curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: application/json' \ --data '' Please find the following PR as a candidate to fix this issue, by not sending body when no body property is declared in the rest client definition: https://git.magnolia-cms.com/projects/MODULES/repos/rest-client/pull-requests/155/overview
|