Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kHttpServerResponse.h
Go to the documentation of this file.
1
10 #ifndef K_API_HTTP_SERVER_RESPONSE_H
11 #define K_API_HTTP_SERVER_RESPONSE_H
12
13 #include <kApi/Io/kNetwork.h>
14
15 kBeginHeader()
16
17
23 typedef k32s kHttpStatus;
24
26 #define kHTTP_STATUS_CONTINUE (100)
27 #define kHTTP_STATUS_SWITCHING_PROTOCOLS (101)
28 #define kHTTP_STATUS_OK (200)
29 #define kHTTP_STATUS_CREATED (201)
30 #define kHTTP_STATUS_ACCEPTED (202)
31 #define kHTTP_STATUS_NON_AUTHORITATIVE (203)
32 #define kHTTP_STATUS_NO_CONTENT (204)
33 #define kHTTP_STATUS_RESET_CONTENT (205)
34 #define kHTTP_STATUS_PARTIAL_CONTENT (206)
35 #define kHTTP_STATUS_MULTIPLE_CHOICES (300)
36 #define kHTTP_STATUS_MOVED_PERMANENTLY (301)
37 #define kHTTP_STATUS_FOUND (302)
38 #define kHTTP_STATUS_SEE_OTHER (303)
39 #define kHTTP_STATUS_NOT_MODIFIED (304)
40 #define kHTTP_STATUS_USE_PROXY (305)
41 #define kHTTP_STATUS_TEMPORARY_REDIRECT (307)
42 #define kHTTP_STATUS_BAD_REQUEST (400)
43 #define kHTTP_STATUS_UNAUTHORIZED (401)
44 #define kHTTP_STATUS_PAYMENT_REQUIRED (402)
45 #define kHTTP_STATUS_FORBIDDEN (403)
46 #define kHTTP_STATUS_NOT_FOUND (404)
47 #define kHTTP_STATUS_METHOD_NOT_ALLOWED (405)
48 #define kHTTP_STATUS_NOT_ACCEPTABLE (406)
49 #define kHTTP_STATUS_PROXY_AUTH_REQUIRED (407)
50 #define kHTTP_STATUS_REQUEST_TIMEOUT (408)
51 #define kHTTP_STATUS_CONFLICT (409)
52 #define kHTTP_STATUS_GONE (410)
53 #define kHTTP_STATUS_LENGTH_REQUIRED (411)
54 #define kHTTP_STATUS_PRECONDITION_FAILED (412)
55 #define kHTTP_STATUS_REQUEST_ENTITY_SIZE (413)
56 #define kHTTP_STATUS_REQUEST_URI_SIZE (414)
57 #define kHTTP_STATUS_UNSUPPORTED_MEDIA_TYPE (415)
58 #define kHTTP_STATUS_INVALID_RANGE (416)
59 #define kHTTP_STATUS_EXPECTATION_FAILED (417)
60 #define kHTTP_STATUS_INTERNAL_SERVER_ERROR (500)
61 #define kHTTP_STATUS_NOT_IMPLEMENTED (501)
62 #define kHTTP_STATUS_BAD_GATEWAY (502)
63 #define kHTTP_STATUS_SERVICE_UNAVAILABLE (503)
64 #define kHTTP_STATUS_GATEWAY_TIMEOUT (504)
65 #define kHTTP_STATUS_UNSUPPORTED_VERSION (505)
66
74 //typedef kObject kHttpServerResponse; --forward-declared in kApiDef.x.h
75
88 kFx(kStatus) kHttpServerResponse_SetVersion(kHttpServerResponse response, kVersion version);
89
102 kFx(kStatus) kHttpServerResponse_SetStatus(kHttpServerResponse response, kHttpStatus status);
103
116 kFx(kStatus) kHttpServerResponse_SetReason(kHttpServerResponse response, const kChar* reason);
117
130 kFx(kStatus) kHttpServerResponse_SetClosed(kHttpServerResponse response, kBool closed);
131
150 kFx(kStatus) kHttpServerResponse_AddHeader(kHttpServerResponse response, const kChar* name, const kChar* value);
151
167 kFx(kStatus) kHttpServerResponse_SetHeader(kHttpServerResponse response, const kChar* name, const kChar* value);
168
182 kFx(kStatus) kHttpServerResponse_BeginWriteContent(kHttpServerResponse response, k64u length, kStream* stream);
183
198 kFx(kStatus) kHttpServerResponse_BeginWriteChunk(kHttpServerResponse response, k64u length, kStream* stream);
199
200 kEndHeader()
201
202 #include <kApi/Io/kHttpServerResponse.x.h>
203
204 #endif
k64u
Represents a 64-bit unsigned integer.
kHttpServerResponse::kHttpServerResponse_BeginWriteContent
kStatus kHttpServerResponse_BeginWriteContent(kHttpServerResponse response, k64u length, kStream *stream)
Begins writing a simple message body.
kHttpServerResponse::kHttpServerResponse_SetReason
kStatus kHttpServerResponse_SetReason(kHttpServerResponse response, const kChar *reason)
Sets the HTTP status description associated with this response.
kHttpServerResponse::kHttpServerResponse_SetStatus
kStatus kHttpServerResponse_SetStatus(kHttpServerResponse response, kHttpStatus status)
Sets the HTTP status code associated with this response.
kChar
Represents a single unit (byte) in a UTF-8 character.
kHttpServerResponse::kHttpServerResponse_BeginWriteChunk
kStatus kHttpServerResponse_BeginWriteChunk(kHttpServerResponse response, k64u length, kStream *stream)
Begins writing a chunk-encoded message body segment.
kHttpServerResponse::kHttpServerResponse_SetHeader
kStatus kHttpServerResponse_SetHeader(kHttpServerResponse response, const kChar *name, const kChar *value)
Sets the value of a header in the response.
kHttpStatus
HTTP status code.
kStream
Represents an I/O stream.
k32s
Represents a 32-bit signed integer.
kHttpServerResponse::kHttpServerResponse_SetClosed
kStatus kHttpServerResponse_SetClosed(kHttpServerResponse response, kBool closed)
Instructs the HTTP server to close this connection when message processing is complete.
kHttpServerResponse
Supports HTTP server response formatting.
kNetwork.h
IP networking definitions.
kVersion
Represents a version number.
kStatus
Represents an error code.
kHttpServerResponse::kHttpServerResponse_AddHeader
kStatus kHttpServerResponse_AddHeader(kHttpServerResponse response, const kChar *name, const kChar *value)
Adds a header value to the response.
kBool
Represents a boolean value.
kHttpServerResponse::kHttpServerResponse_SetVersion
kStatus kHttpServerResponse_SetVersion(kHttpServerResponse response, kVersion version)
Sets the version associated with this HTTP response.