-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
When sending a request with Content-Type text/plain;charset=UTF-8, the tool incorrectly attempts to parse the response as JSON and throws an error: "Unexpected token '测', '测试' is not valid JSON".
Steps to Reproduce
-
Create a GET request with:
- URL:
http://localhost:8080/api/hello/message?key=testMessage - Header:
Content-Type: text/plain;charset=UTF-8
- URL:
-
Send the request containing plain text content ("测试") in the body.
Expected Behavior
The tool should:
- Recognize the Content-Type header
- Display the plain text response without attempting JSON parsing
- Show the response text ("测试") in the output panel
Actual Behavior
- Error message appears: "Unexpected token '测', '测试' is not valid JSON"
- The response body is not properly displayed as plain text
Additional Context
- Version: [Insert tool/version number here]
- Environment: [Browser/OS if applicable]
- API Endpoint: Shows "status code: 200" but fails to render content
Proposed Fix
Modify the response handling to:
- Check the Content-Type header before processing
- Use appropriate renderer based on Content-Type
- Fallback to plain text display if content isn't parseable as JSON
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
