smartstatus/ts/smartstatus.classes.http.1xx.ts

47 lines
1.8 KiB
TypeScript
Raw Normal View History

2019-01-02 00:00:53 +00:00
import { HttpStatus, TStatusGroup } from './smartstatus.classes.http';
2019-01-02 01:08:12 +00:00
export class Status100 extends HttpStatus {
2019-01-02 00:00:53 +00:00
constructor() {
super({
code: 100,
text: 'Continue',
description: `The server has received the request headers and the client
2017-04-11 09:10:15 +00:00
should proceed to send the request body
(in the case of a request for which a body needs to be sent; for example, a POST request).
Sending a large request body to a server after a request has been rejected
for inappropriate headers would be inefficient.
To have a server check the request's headers,
a client must send Expect: 100-continue as a header in its initial request and receive
a 100 Continue status code in response before sending the body.
2021-08-16 13:36:41 +00:00
The response 417 Expectation Failed indicates the request should not be continued.`,
2019-01-02 00:00:53 +00:00
});
2017-04-11 09:10:15 +00:00
}
}
2019-01-02 01:08:12 +00:00
HttpStatus.addStatus('100', Status100);
2017-04-11 09:10:15 +00:00
2019-01-02 01:08:12 +00:00
export class Status101 extends HttpStatus {
2019-01-02 00:00:53 +00:00
constructor() {
super({
code: 101,
text: 'Switching Protocols',
2021-08-16 13:36:41 +00:00
description: `The requester has asked the server to switch protocols and the server has agreed to do so.`,
2019-01-02 00:00:53 +00:00
});
2017-04-11 09:10:15 +00:00
}
}
2019-01-02 01:08:12 +00:00
HttpStatus.addStatus('101', Status101);
2017-04-11 09:10:15 +00:00
2019-01-02 01:08:12 +00:00
export class Status102 extends HttpStatus {
2019-01-02 00:00:53 +00:00
constructor() {
super({
code: 102,
text: 'Non-Authoritative Information',
description: `A WebDAV request may contain many sub-requests involving file operations,
2017-04-11 09:10:15 +00:00
requiring a long time to complete the request.
This code indicates that the server has received and is processing the request,
but no response is available yet.[6]
2021-08-16 13:36:41 +00:00
This prevents the client from timing out and assuming the request was lost.`,
2019-01-02 00:00:53 +00:00
});
2017-04-11 09:10:15 +00:00
}
2019-01-02 00:00:53 +00:00
}
2019-01-02 01:08:12 +00:00
HttpStatus.addStatus('102', Status102);