OutSystems Platform uses the following HTTP status codes when working with exposed REST API methods:

Status Code

Text

Description

200

OK

Success.

400

Bad Request

Problem with the request. See the response body for more information.

401

Unauthorized

Missing Authorization header when the method uses Basic authentication.

403

Forbidden

The service requires SSL, or allows access only according to the Internal Network environment setting. Learn more about the Internal Network environment setting.

404

Not Found

The specified REST API or method doesn't exist.

405

Method Not Allowed

The REST API Method is not allowed to be used with the specified HTTP method (e. g. you are calling the REST API method with a PUT request instead of POST).

406

Not Acceptable

The 'Accept' header of the request requires a response media type that is not supported.

415

Unsupported Media Type

The method expects a different 'Content-Type' header value in the request.

500

Internal Server Error

Any unhandled exception that appears in the application logic. See the response body for more information.

Set the HTTP Status Code of the Response

Sometimes you need to send a different HTTP status code from the ones described above. For example, when a record was successfully created, it's common to use the '201 Created' status code.

To set a specific HTTP status code in the response, do the following:

  1. Reference the SetStatusCode action of the HTTPRequestHandler extension;
  2. Use the SetStatusCode action in the REST API method flow right before the end node. Set its 'StatusCode' property to the status code you need.

Please note that this is an advanced extensibility scenario, so be sure to test if it works as intended in your specific infrastructure.

See Also

Handling Errors in REST