Skip to content

Commit c1ad448

Browse files
authored
Merge branch 'v1.x' into fix/proxy-from-env-v2-fix
2 parents 044de6b + ebc6056 commit c1ad448

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,12 @@ These are the available config options for making requests. Only the `url` is re
624624
transitional: {
625625
// silent JSON parsing mode
626626
// `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour)
627-
// `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json')
627+
// `false` - throw SyntaxError if JSON parsing failed
628+
// Important: this option only takes effect when `responseType` is explicitly set to 'json'.
629+
// When `responseType` is omitted (defaults to no value), axios uses `forcedJSONParsing`
630+
// to attempt JSON parsing, but will silently return the raw string on failure regardless
631+
// of this setting. To have invalid JSON throw errors, use:
632+
// { responseType: 'json', transitional: { silentJSONParsing: false } }
628633
silentJSONParsing: true, // default value for the current Axios version
629634

630635
// try to parse the response string as JSON even if `responseType` is not 'json'

0 commit comments

Comments
 (0)