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
21 typedef k32s kHttpStatus;
22
24 #define kHTTP_STATUS_CONTINUE (100)
25 #define kHTTP_STATUS_SWITCHING_PROTOCOLS (101)
26 #define kHTTP_STATUS_OK (200)
27 #define kHTTP_STATUS_CREATED (201)
28 #define kHTTP_STATUS_ACCEPTED (202)
29 #define kHTTP_STATUS_NON_AUTHORITATIVE (203)
30 #define kHTTP_STATUS_NO_CONTENT (204)
31 #define kHTTP_STATUS_RESET_CONTENT (205)
32 #define kHTTP_STATUS_PARTIAL_CONTENT (206)
33 #define kHTTP_STATUS_MULTIPLE_CHOICES (300)
34 #define kHTTP_STATUS_MOVED_PERMANENTLY (301)
35 #define kHTTP_STATUS_FOUND (302)
36 #define kHTTP_STATUS_SEE_OTHER (303)
37 #define kHTTP_STATUS_NOT_MODIFIED (304)
38 #define kHTTP_STATUS_USE_PROXY (305)
39 #define kHTTP_STATUS_TEMPORARY_REDIRECT (307)
40 #define kHTTP_STATUS_BAD_REQUEST (400)
41 #define kHTTP_STATUS_UNAUTHORIZED (401)
42 #define kHTTP_STATUS_PAYMENT_REQUIRED (402)
43 #define kHTTP_STATUS_FORBIDDEN (403)
44 #define kHTTP_STATUS_NOT_FOUND (404)
45 #define kHTTP_STATUS_METHOD_NOT_ALLOWED (405)
46 #define kHTTP_STATUS_NOT_ACCEPTABLE (406)
47 #define kHTTP_STATUS_PROXY_AUTH_REQUIRED (407)
48 #define kHTTP_STATUS_REQUEST_TIMEOUT (408)
49 #define kHTTP_STATUS_CONFLICT (409)
50 #define kHTTP_STATUS_GONE (410)
51 #define kHTTP_STATUS_LENGTH_REQUIRED (411)
52 #define kHTTP_STATUS_PRECONDITION_FAILED (412)
53 #define kHTTP_STATUS_REQUEST_ENTITY_SIZE (413)
54 #define kHTTP_STATUS_REQUEST_URI_SIZE (414)
55 #define kHTTP_STATUS_UNSUPPORTED_MEDIA_TYPE (415)
56 #define kHTTP_STATUS_INVALID_RANGE (416)
57 #define kHTTP_STATUS_EXPECTATION_FAILED (417)
58 #define kHTTP_STATUS_UPGRADE_REQUIRED (426)
59 #define kHTTP_STATUS_INTERNAL_SERVER_ERROR (500)
60 #define kHTTP_STATUS_NOT_IMPLEMENTED (501)
61 #define kHTTP_STATUS_BAD_GATEWAY (502)
62 #define kHTTP_STATUS_SERVICE_UNAVAILABLE (503)
63 #define kHTTP_STATUS_GATEWAY_TIMEOUT (504)
64 #define kHTTP_STATUS_UNSUPPORTED_VERSION (505)
65
67 #include <kApi/Io/kHttpServerResponse.x.h>
68
75 //typedef kObject kHttpServerResponse; --forward-declared in kApiDef.x.h
76
89 kFx(kStatus) kHttpServerResponse_SetVersion(kHttpServerResponse response, kVersion version);
90
103 kFx(kStatus) kHttpServerResponse_SetStatus(kHttpServerResponse response, kHttpStatus status);
104
117 kFx(kStatus) kHttpServerResponse_SetReason(kHttpServerResponse response, const kChar* reason);
118
131 kFx(kStatus) kHttpServerResponse_SetClosed(kHttpServerResponse response, kBool closed);
132
151 kFx(kStatus) kHttpServerResponse_AddHeader(kHttpServerResponse response, const kChar* name, const kChar* value);
152
168 kFx(kStatus) kHttpServerResponse_SetHeader(kHttpServerResponse response, const kChar* name, const kChar* value);
169
183 kFx(kStatus) kHttpServerResponse_BeginWriteContent(kHttpServerResponse response, k64u length, kStream* stream);
184
199 kFx(kStatus) kHttpServerResponse_BeginWriteChunk(kHttpServerResponse response, k64u length, kStream* stream);
200
201 #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.