Skip to content

doc: cli-option --json is an alias of --data-binary #15197

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

Closed
wants to merge 1 commit into from

Conversation

sivizius
Copy link
Contributor

@sivizius sivizius commented Oct 8, 2024

Due to https://github.com/curl/curl/blob/master/src/tool_getparam.c#L879-L880, --json is actually an alias for --data-binary, not --data. Assuming the code is as intended, the documentation should reflect that.

I encountered this by switching from -h 'Content-Type: application/json' -d @invalid.json to --json @invalid.json in a test, that expected a parsing-error, which contains some information about the line and column. However, due to effectively switching to --data-binary, the line and column were off and the test failed.

This PR does not change the behaviour of this test, but correctly informs the user about the actual behaviour of --json.

@bagder bagder closed this in adca93b Oct 8, 2024
@bagder
Copy link
Member

bagder commented Oct 8, 2024

Thanks!

ftnext added a commit to ftnext/everything-curl that referenced this pull request Feb 22, 2025
bagder pushed a commit to curl/everything-curl that referenced this pull request Feb 22, 2025
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants