1 Long: fail-with-body 2 Protocols: HTTP 3 Help: Fail on HTTP errors but save the body 4 Category: http output 5 Added: 7.76.0 6 See-also: fail 7 Example: --fail-with-body $URL 8 --- 9 Return an error on server errors where the HTTP response code is 400 or 10 greater). In normal cases when an HTTP server fails to deliver a document, it 11 returns an HTML document stating so (which often also describes why and 12 more). This flag will still allow curl to output and save that content but 13 also to return error 22. 14 15 This is an alternative option to --fail which makes curl fail for the same 16 circumstances but without saving the content. 17