Skip to content

Conversation

mohammadb24chat
Copy link

fixes content-type: text/plain;charset=UTF-8 issue

  • Changed the request body from body: JSON.stringify({ refreshToken: currentRefreshToken }) to json: { refreshToken: currentRefreshToken } in packages/rest/src/hooks/refresh-token.after-response.hook.ts.

@mohammadb24chat mohammadb24chat requested a review from a team as a code owner October 6, 2025 10:20
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 7cc81d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Oct 6, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7cc81d8
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/68e397d5d2643d0008c4baba
😎 Deploy Preview https://deploy-preview-7044--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@BatuhanW
Copy link
Member

BatuhanW commented Oct 9, 2025

Hey @mohammadb24chat can you explain the problem here? Also you need to create changeset. You can check here.

https://refine.dev/docs/guides-concepts/contributing/

@mohammadb24chat
Copy link
Author

Hey @mohammadb24chat can you explain the problem here? Also you need to create changeset. You can check here.

https://refine.dev/docs/guides-concepts/contributing/

Hi 👋,

First, I’d like to apologize for not following the contributing guidelines earlier — I appreciate your patience.

While working on this, I ran into two issues that led me to create a similar custom hook:

  1. Content-Type issue — The backend (NestJS with @Body and class-validator DTOs) couldn’t parse the request body as JSON because the Content-Type header was set to "text/plain;charset=UTF-8".
    Using "json" instead of "body" resolved this issue.

  2. Improved flexibility — One of the things I really like about Refine is its flexibility to integrate with different backend architectures.
    Adding support for buildQueryParams and mapResponse would make it even more adaptable in various use cases.

Here’s a quick overview of the custom hook I created:

image

Thank you for reviewing this PR 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants