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

Fix Python code sample JSON body #2976

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rodrcastro
Copy link
Contributor

@rodrcastro rodrcastro commented Mar 12, 2025

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

⚠️ 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

argos-ci bot commented Mar 12, 2025

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

@nolannbiron
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.

@nolannbiron
Copy link
Member

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

@nolannbiron
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants