Skip to content

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

Closed
sivizius wants to merge 1 commit into
curl:masterfrom
sivizius:docfix-json-cli-option
Closed

doc: cli-option --json is an alias of --data-binary#15197
sivizius wants to merge 1 commit into
curl:masterfrom
sivizius:docfix-json-cli-option

Conversation

@sivizius

@sivizius sivizius commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

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

bagder commented Oct 8, 2024

Copy link
Copy Markdown
Member

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