gitbook icon indicating copy to clipboard operation
gitbook copied to clipboard

Fix Python code sample JSON body

Open rodrcastro opened this issue 10 months ago • 7 comments

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

rodrcastro avatar Mar 12 '25 18:03 rodrcastro

⚠️ No Changeset found

Latest commit: 631cecc826f2f96dfde42ba4dedf755810e737cc

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

changeset-bot[bot] avatar Mar 12 '25 18:03 changeset-bot[bot]

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

argos-ci[bot] avatar Mar 12 '25 18:03 argos-ci[bot]

@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 avatar Mar 14 '25 08:03 nolannbiron

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

nolannbiron avatar Mar 14 '25 08:03 nolannbiron

@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

nolannbiron avatar Mar 19 '25 21:03 nolannbiron