'--data', or '-d', is defined for form-encoded content and removes carriage returns and newlines when the argument reads from a file with the at-sign syntax. Posting a JSON document with 'curl -d @payload.json' therefore sends a single line, which is usually still valid JSON and hides the problem, but posting a PEM certificate, a multi-line script, or anything whitespace-sensitive corrupts it silently.
'--data-binary @payload.json' sends the file exactly as it is on disk. Use it for every file-sourced body. '--data-raw' is the equivalent for a literal string and additionally stops curl from interpreting a leading at-sign as a filename, which matters when the value comes from a variable.
Related: '-d' with a literal string does not URL-encode the value, so an ampersand or an equals sign inside a field breaks the encoding. '--data-urlencode name=value' encodes correctly and has its own at-sign and less-than forms for reading from a file. Since curl 7.82.0, '--json' sets the content type and accept headers and behaves like --data-binary in one flag.