Expect¶
Adds a status code that the response is allowed to have.
1 | |
Parameters¶
string status
The status code name, such as Created or NotFound.
Returns¶
The current RestRequest instance.
Remarks¶
Without this method, each execution method uses its own default status codes. When Expect is used, only the expected status codes are accepted. Call it several times to accept several status codes.
The status code must be one of the following values from the Status column:
Examples¶
Accept the status code of a created resource¶
1 2 3 4 5 6 | |
Handle an expected error status¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | |