Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AddJsonBody overload to serialise top-level string #2043

Merged
merged 2 commits into from Apr 4, 2023

Conversation

alexeyzimarev
Copy link
Member

@alexeyzimarev alexeyzimarev commented Apr 3, 2023

Description

Proposal to fix #1954.

Add a AddJsonBody overload with string payload argument with forceSerialize argument. If forceSerialize is set to true, the string will be serialised. If it's set to false, the string will be sent as-is.

Purpose

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

It's not a strictly breaking change, I think it might be released a s a minor version.

@cloudflare-pages
Copy link

cloudflare-pages bot commented Apr 4, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b27dff0
Status: ✅  Deploy successful!
Preview URL: https://8f5407b7.restsharp.pages.dev
Branch Preview URL: https://json-string-body.restsharp.pages.dev

View logs

@alexeyzimarev alexeyzimarev changed the title Hacky way to find out if the JSON body string is already serialized Add AddJsonBody overload to serialise top-level string Apr 4, 2023
@alexeyzimarev alexeyzimarev merged commit bf24794 into dev Apr 4, 2023
4 checks passed
@repo-ranger repo-ranger bot deleted the json-string-body branch April 4, 2023 16:33
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.

AddJsonBody handles strings in a usually user-friendly but incorrect way
1 participant