mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #4857] [bug]: invalid json body #1826
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1826
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frankliexodus on GitHub (Mar 7, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4857
Originally assigned to: @CuriousCorrelation on GitHub.
Is there an existing issue for this?
Current behavior
When I use the UI I get back the error that the JSON is invalid.
However when I take the curl command code and run it in my terminal there isn't such an issue. It leads me to believe that there is a formatting issue when the request body is sent.
Steps to reproduce
Add request body to post. Click submit
Environment
Production
Version
Cloud
@frankliexodus commented on GitHub (Mar 7, 2025):
From the backend printing out the string here is what I'm seeing
Looks like we aren't serializing the body properly
@frankliexodus commented on GitHub (Mar 7, 2025):
The problem does not occur in the desktop version
@CuriousCorrelation commented on GitHub (Mar 7, 2025):
Hi, thanks for the report. And thanks for confirming that this doesn't occur on the desktop app.
Could you share which interceptor your are using, and if this occurs on any other website, say perhaps sending similar request to https://echo.hoppscotch.io and seeing
[object Object]in the response body?@boarush commented on GitHub (Mar 7, 2025):
I am using the Chrome extension as the interceptor and I am only seeing this when sending a POST request, so definitely a problem in serializing the JSON body.
For GET requests, I am not getting any issues in the response body.
@brunnobb commented on GitHub (Mar 7, 2025):
Check
https://github.com/hoppscotch/hoppscotch/issues/4837#issuecomment-2704991884
@formbook commented on GitHub (Mar 7, 2025):
this problem is occurring in the browser also, with firefox, endpoint is tested as working
Failed to parse the request body as JSON: [0]: expected value at line 1 column 2
@robmv commented on GitHub (Mar 7, 2025):
It is failing for me on Firefox with the extension interceptor v0.37. The packet capture shows it is sending the toString() of a JS object.
@bernardassan commented on GitHub (Mar 7, 2025):
I was facing this issue yesterday and found that it was an issue with
hoppscotchafter doing a repro that was working for bothcurlandpostmanbut nothoppscotch. I was about creating a new issue, good to see this.This is only affecting
POSTrequest as was previously stated. Sending anyjsondata leads to the same result.I am using
firefoxbrowser with theextension.@brunnobb commented on GitHub (Mar 7, 2025):
A quick debug on the plugin has shown where the issue is..
seems to be missing a JSON.stringfy..
Because axiosConfig.data here is a json object..
but fetch needs it stringfied. As it is not using axios (naming implies that it were axios before, and axios automatically stringfies content.
@SaiRev0 commented on GitHub (Mar 8, 2025):
Its happening in desktop application as well.
@yassentials commented on GitHub (Mar 10, 2025):
I got this response from my backend app (I am using MS Edge with extension)
Here is my request
Content-Type: application/json@jamesgeorge007 commented on GitHub (Mar 11, 2025):
Hi, we have a PR with the fix scheduled for the next patch release.
@jamesgeorge007 commented on GitHub (Mar 13, 2025):
Closing this issue since it's resolved in the latest release. Please let us know if you have any feedback.