EMS.ResourceAPI.TEndpointResponse.SetCreated

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetCreated(const ALocation: string; AStatusCode: Integer = 201); virtual; abstract;

C++

virtual void __fastcall SetCreated(const System::UnicodeString ALocation, int AStatusCode = 0xc9) = 0 ;

Properties

Type Visibility Source Unit Parent
procedure
function
public
EMS.ResourceAPI.pas
EMS.ResourceAPI.hpp
EMS.ResourceAPI TEndpointResponse

Description

As a result of the handling of the request context that triggered this response, the EMS resource that handles that request context created a new REST resource. SetCreated indicates the location where EMS client applications can access that new REST resource.

By default, SetCreated changes the status code of the response to 201, which indicates that you fulfilled the request to create a new REST resource. You may provide a different value for AStatusCode if you wish. For example, pass 202 as the value of the AStatusCode parameter to indicate that you accepted the request to create a new REST resource, but the new REST resource will be created asynchronously, and it may not be available yet by the time that your response reaches the EMS client application that sent the original request.

See Also