350-401 · Question #465
Which HTTP code must be returned to prevent the script form exiting?
The correct answer is A. 200. To indicate successful processing and prevent a script from exiting prematurely due to an error, an HTTP 200 OK status code must be returned.
Question
Which HTTP code must be returned to prevent the script form exiting?
Exhibits
Options
- A200
- B201
- C300
- D301
How the community answered
(51 responses)- A92% (47)
- B2% (1)
- C2% (1)
- D4% (2)
Why each option
To indicate successful processing and prevent a script from exiting prematurely due to an error, an HTTP 200 OK status code must be returned.
An HTTP status code of 200 (OK) indicates that the request has succeeded. For scripts interacting with web services, receiving any 2xx status code generally signifies success, allowing the script to continue its execution flow as intended without encountering an error that would cause it to exit.
An HTTP 201 (Created) status code indicates that the request has been fulfilled and has resulted in one or more new resources being created; while a success code, it's specific to resource creation and might not be interpreted as a generic "continue processing" by all scripts.
An HTTP 300 (Multiple Choices) status code indicates that the requested resource has multiple possible responses, requiring the user agent to choose one, which would likely be treated as an error or unexpected condition by a script.
An HTTP 301 (Moved Permanently) status code indicates that the resource has been permanently moved to a new URL, which would cause a script to redirect or interpret it as a non-success state for the original request.
Concept tested: HTTP status codes for script success
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200
Topics
Community Discussion
No community discussion yet for this question.

