Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Python code sample JSON body #2976

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

Open
rodrcastro wants to merge 3 commits into main
base: main
Choose a base branch
Loading
from rodrigo/rnd-6538-json-body-in-python-code-sample-is-not-being-set

Conversation

@rodrcastro
Copy link
Contributor

@rodrcastro rodrcastro commented Mar 12, 2025
edited
Loading

When sending a JSON body in the request, it should use json. This PR changes it to make the code sample request correct.

Copy link

linear bot commented Mar 12, 2025

Copy link

changeset-bot bot commented Mar 12, 2025
edited
Loading

⚠️ No Changeset found

Latest commit: 631cecc

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
Contributor

github-actions bot commented Mar 12, 2025
edited
Loading

Copy link

argos-ci bot commented Mar 12, 2025
edited
Loading

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v1 (Inspect) ⚠️ Changes detected (Review) 13 changed Mar 19, 2025, 8:56 PM
customers-v2 (Inspect) ⚠️ Changes detected (Review) 12 changed Mar 19, 2025, 8:56 PM
default (Inspect) ⚠️ Changes detected (Review) 31 changed Mar 19, 2025, 8:57 PM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 22 changed Mar 19, 2025, 9:00 PM

Copy link
Member

@rodrcastro We are using data instead of json to handle any content type.

If you want to send text/csv, text/plain or multipart, you can’t use json, it’s just a shorthand that implicitly sets the content type to application/json.

data works with any content type, as long as you specify it in the headers.

Copy link
Member

but we can set it to json for application/json, if customers really want to see this instead of data

Copy link
Member

@SamyPesse @rodrcastro I've updated the code to handle json={} for application/json and data={} for others content type, I made this because we had a past issue to handle multiple content type

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

Reviewers

@SamyPesse SamyPesse SamyPesse approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /